Play a Music File

:smiley: Hello,

I was wondering if there was a code that would play a file of music,
when called upon?

Thanks.

Tj Superfly wrote:

:smiley: Hello,

I was wondering if there was a code that would play a file of music,
when called upon?

Thanks.

require ‘win32ole’
player = WIN32OLE.new(‘WMPlayer.OCX’)
player.OpenPlayer(‘c:\music\van halen\right now.wma’)

~Jeremy

Quoth Tj Superfly:

:smiley: Hello,

I was wondering if there was a code that would play a file of music,
when called upon?

Thanks.

Or if you’re not on windows:

mplayer my_music_file.wav

Regards,

Hi,

thank you for the link, but it’s not what I was looking for. I do not
need to play the mp3 file. I need to be able to analyze it on the
backend; that is, to get its length in seconds, and possibly truncate it
(not necessary). I was doing it in Java so far. If I can’t do this on
the backend, I can’t switch to Ruby, which is what I would love to do.

Thanks.

Peter

Konrad M. wrote:

Quoth Tj Superfly:

:smiley: Hello,

I was wondering if there was a code that would play a file of music,
when called upon?

Thanks.

Or if you’re not on windows:

mplayer my_music_file.wav

Regards,

I responded to a wrong thread…

Peter

Petr Kout wrote:

Hi,

thank you for the link, but it’s not what I was looking for. I do not
need to play the mp3 file. I need to be able to analyze it on the
backend; that is, to get its length in seconds, and possibly truncate it
(not necessary). I was doing it in Java so far. If I can’t do this on
the backend, I can’t switch to Ruby, which is what I would love to do.

Thanks.

Peter

Konrad M. wrote:

Quoth Tj Superfly:

:smiley: Hello,

I was wondering if there was a code that would play a file of music,
when called upon?

Thanks.

Or if you’re not on windows:

mplayer my_music_file.wav

Regards,