Play audio file (AAC) from ruby program

I need to play, pause and resume AAC files from a ruby console program
(much like iTunes or any music player).

After much searching, I've come across these libraries:

1. mp3info
2. metadata
3. id3lib-ruby
4. rvideo (uses ffmpeg)

These seem to help me in getting track length and tags which i also
need, but I need something to play AAC (at least) and if possible other
formats. I also must be able to pause and resume (so shelling a program
like mpg321 is out).

···

--
Posted via http://www.ruby-forum.com/.

if its for the mac, you could use MacRuby with QTKit.

···

2010/5/14 R. Kumar <sentinel.2001@gmx.com>

I need to play, pause and resume AAC files from a ruby console program
(much like iTunes or any music player).

After much searching, I've come across these libraries:

1. mp3info
2. metadata
3. id3lib-ruby
4. rvideo (uses ffmpeg)

These seem to help me in getting track length and tags which i also
need, but I need something to play AAC (at least) and if possible other
formats. I also must be able to pause and resume (so shelling a program
like mpg321 is out).
--
Posted via http://www.ruby-forum.com/.

I'm not saying it's the best solution, but you can use mpg321 to
pause and resume. I think you need to use -R

···

On Fri, May 14, 2010 at 10:26 AM, Louis-Philippe <default@spiralix.org> wrote:

if its for the mac, you could use MacRuby with QTKit.

2010/5/14 R. Kumar <sentinel.2001@gmx.com>

I need to play, pause and resume AAC files from a ruby console program
(much like iTunes or any music player).

After much searching, I've come across these libraries:

1. mp3info
2. metadata
3. id3lib-ruby
4. rvideo (uses ffmpeg)

These seem to help me in getting track length and tags which i also
need, but I need something to play AAC (at least) and if possible other
formats. I also must be able to pause and resume (so shelling a program
like mpg321 is out).

--
Luis Parravicini
http://ktulu.com.ar/blog/

Louis-Philippe wrote:

if its for the mac, you could use MacRuby with QTKit.

I am on a mac, but this is a console program so should be usable on
other systems too. Also, Macruby makes it a GUI program, I am using a
character terminal.

···

--
Posted via http://www.ruby-forum.com/.

Luis Parravicini wrote:

These seem to help me in getting track length and tags which i also
need, but I need something to play AAC (at least) and if possible other
formats. I also must be able to pause and resume (so shelling a program
like mpg321 is out).

  I'm not saying it's the best solution, but you can use mpg321 to
pause and resume. I think you need to use -R

Thanks, I just tried it. It gave a malloc error complaining first that
it could only do 44Khz files. (Crashed out on LOAD).

···

--
Posted via http://www.ruby-forum.com/.

Thanks, I just tried it. It gave a malloc error complaining first that
it could only do 44Khz files. (Crashed out on LOAD).

You might also try mplayer in -slave mode. I know that can handle 48k audio.

-Jonathan Nielsen

I've come across a Snack Sound Toolkit,
http://en.wikipedia.org/wiki/Snack_Sound_Toolkit -- seems to be some
ancient bindings to it, less than alpha and untested. It also requires
Tk.

portaudio has some ruby bindings to it: paruby and ruby-portaudio
(http://github.com/jvoorhis/ruby-portaudio/blob/master/lib/portaudio.rb#).
The latter is Feb 2010 the other (paruby) seems quite old and perhaps
abandoned (updated 2006, status: in development).

Someone suggested "afplay" -- this is a command line utility on OSX.
Unfortunately, does not allow me to pause resume.

So it looks like ruby-portaudio may be the best bet at present.

···

--
Posted via http://www.ruby-forum.com/.