Skip to content
Browse files

updating manifest

git-svn-id: svn://rubyforge.org/var/svn/daapclient/icha@131 d404eec9-990f-0410-b7b9-e628b63c8aec
  • Loading branch information...
1 parent 8521c03 commit b79b9aa7385e964c7a6cce112b357fa7bbe8da1a aaronp committed Feb 16, 2008
Showing with 29 additions and 0 deletions.
  1. +1 −0 Manifest.txt
  2. +28 −0 examples/encoder.rb
View
1 Manifest.txt
@@ -4,6 +4,7 @@ Manifest.txt
README.txt
Rakefile
examples/decoder.rb
+examples/encoder.rb
examples/kexp.rb
ext/decoder.c
ext/decoder.h
View
28 examples/encoder.rb
@@ -0,0 +1,28 @@
+require 'icanhasaudio'
+
+include Audio::MPEG
+
+writer = Encoder.new
+
+### NOTE: All of these settings are optional ###
+# The default setup is 128kbps minimum plus VBR.
+
+# Set up the encoder to be 128kbps, NON-VBR
+writer.bitrate = 128
+writer.vbr_type = Encoder::VBR_OFF
+
+# Set the ID3 tags
+writer.title = 'tenderlovemaking.com'
+writer.artist = 'Aaron Patterson'
+writer.album = 'ICANHASAUDIO'
+writer.year = 2008
+writer.track = 1
+writer.genre = 'Porn Groove'
+
+# Make sure to open your outfile as read and write. Writing VBR tags requires
+# seeking through the file.
+File.open(ARGV[1], 'wb+') { |outfile|
+ File.open(ARGV[0], 'rb') { |infile|
+ writer.encode(infile, outfile)
+ }
+}

0 comments on commit b79b9aa

Please sign in to comment.
Something went wrong with that request. Please try again.