Music in Pharo

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Music in Pharo

Clément Béra
Hello,

Can someone tell me how to play music from Pharo ? 

I don't care if the file has to be a mp3, a midi or wav file, I just want to play it from Pharo.

A piece of code as example would be nice.

Thanks

Clement
Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Kjell Godo
what are the Pharo music packages

can they display music on screen

can they control vocaloid and play music at the same time

i know nothing

On Saturday, July 4, 2015, Clément Bera <[hidden email]> wrote:
Hello,

Can someone tell me how to play music from Pharo ? 

I don't care if the file has to be a mp3, a midi or wav file, I just want to play it from Pharo.

A piece of code as example would be nice.

Thanks

Clement
Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Sean P. DeNigris
Administrator
In reply to this post by Clément Béra
Clément Bera-4 wrote
Can someone tell me how to play music from Pharo ?
You can check out this experiment I did http://smalltalkhub.com/#!/~SeanDeNigris/FMOD . IIRC I used it to play mp3 files.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Peter Uhnak
In reply to this post by Kjell Godo
Maybe this can be of help.

Not sure if there is built version of it somewhere but you can always clone it and build it yourself.

Peter

On Sat, Jul 4, 2015 at 3:42 PM, Kjell Godo <[hidden email]> wrote:
what are the Pharo music packages

can they display music on screen

can they control vocaloid and play music at the same time

i know nothing


On Saturday, July 4, 2015, Clément Bera <[hidden email]> wrote:
Hello,

Can someone tell me how to play music from Pharo ? 

I don't care if the file has to be a mp3, a midi or wav file, I just want to play it from Pharo.

A piece of code as example would be nice.

Thanks

Clement

Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

stepharo
Thanks peter!
And thanks Stef and Xavier for this great chapter :)

Stef


Le 4/7/15 15:46, Peter Uhnák a écrit :
Maybe this can be of help.

Not sure if there is built version of it somewhere but you can always clone it and build it yourself.

Peter

On Sat, Jul 4, 2015 at 3:42 PM, Kjell Godo <[hidden email]> wrote:
what are the Pharo music packages

can they display music on screen

can they control vocaloid and play music at the same time

i know nothing


On Saturday, July 4, 2015, Clément Bera <[hidden email]> wrote:
Hello,

Can someone tell me how to play music from Pharo ? 

I don't care if the file has to be a mp3, a midi or wav file, I just want to play it from Pharo.

A piece of code as example would be nice.

Thanks

Clement


Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Attila Magyar
In reply to this post by Clément Béra
I recently created a simple google translator based text to speech engine, that calls the google webservice, saves the output mp3 in a temp file then plays it. I use the StreamingMP3Sound class from http://www.squeaksource.com/SPDProjectUpdates/ to play files.

Gofer new
    smalltalkhubUser: 'zeroflag' project: 'PhSpeaker';
    package: 'ConfigurationOfPhSpeaker';
    load.
(ConfigurationOfPhSpeaker project version: #development) load.

SoundSystem soundEnabled: true. "enable sounds in Pharo"

(PTGoogleTTS language: 'en') readText: 'Hello world'.

You can check the ConfigurationOfPhSpeaker for the dependencies, and PTGoogleTTS>>playFile: for playing mp3.
Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Clément Béra
Hello Attila,

I tried your code but the primitive #primFileValidMPEG: fails and Pharo doesn't read the mp3. I checked the mp3 file generated can be read by regular mp3 player but fails on in Pharo.

Is there a specific plugin you need to compile the VM with ? I am not sure the Mpeg3Plugin is by default in any VM I have.

Thanks

2015-07-04 20:46 GMT+02:00 Attila Magyar <[hidden email]>:
I recently created a simple google translator based text to speech engine,
that calls the google webservice, saves the output mp3 in a temp file then
plays it. I use the StreamingMP3Sound class from
http://www.squeaksource.com/SPDProjectUpdates/ to play files.

Gofer new
    smalltalkhubUser: 'zeroflag' project: 'PhSpeaker';
    package: 'ConfigurationOfPhSpeaker';
    load.
(ConfigurationOfPhSpeaker project version: #development) load.

SoundSystem soundEnabled: true. "enable sounds in Pharo"

(PTGoogleTTS language: 'en') readText: 'Hello world'.

You can check the ConfigurationOfPhSpeaker for the dependencies, and
PTGoogleTTS>>playFile: for playing mp3.



--
View this message in context: http://forum.world.st/Music-in-Pharo-tp4835737p4835780.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Attila Magyar
Hi Clément,

I don't use any special vm, but the one that comes with Pharo4 (http://files.pharo.org/platform/Pharo4.0-win.zip). I haven't tried it on mac however, only windows and raspbian.

On the raspberry pi I use this vm with a Pharo5 spur image:

http://www.mirandabanda.org/files/Cog/VM/VM.r3395/cogspurlinuxhtARM-15.26.3395.tgz

Sometimes I got "PrimitiveFailed: primitive #primFileClose: in MPEGFile failed" when I try to close the file, but only after it successfully played it.
Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Clément Béra
Hum. I am on mac maybe this is why it doesn't work for me then.

I will try the other solution proposed.

Thanks.

2015-07-05 12:42 GMT+02:00 Attila Magyar <[hidden email]>:
Hi Clément,

I don't use any special vm, but the one that comes with Pharo4
(http://files.pharo.org/platform/Pharo4.0-win.zip). I haven't tried it on
mac however, only windows and raspbian.

On the raspberry pi I use this vm with a Pharo5 spur image:

http://www.mirandabanda.org/files/Cog/VM/VM.r3395/cogspurlinuxhtARM-15.26.3395.tgz

Sometimes I got "PrimitiveFailed: primitive #primFileClose: in MPEGFile
failed" when I try to close the file, but only after it successfully played
it.



--
View this message in context: http://forum.world.st/Music-in-Pharo-tp4835737p4835821.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

Sean P. DeNigris
Administrator
In reply to this post by Clément Béra
Clément Bera-4 wrote
I tried your code but the primitive #primFileValidMPEG: fails and Pharo
doesn't read the mp3.
Same for me on Mac 10.9.5. I'm using the VM that comes with Launcher.

Clément Bera-4 wrote
Is there a specific plugin you need to compile the VM with ? I am not sure
the Mpeg3Plugin is by default in any VM I have.
I see the Mpeg3Plugin in the Plugins folder. I know I had this working at some point. Maybe the mp3 plugin has deteriorated in newer VMs? Maybe I'll dig up an older VM and see...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Music in Pharo

EstebanLM

> On 06 Jul 2015, at 05:14, Sean P. DeNigris <[hidden email]> wrote:
>
> Clément Bera-4 wrote
>> I tried your code but the primitive #primFileValidMPEG: fails and Pharo
>> doesn't read the mp3.
>
> Same for me on Mac 10.9.5. I'm using the VM that comes with Launcher.
>
>
> Clément Bera-4 wrote
>> Is there a specific plugin you need to compile the VM with ? I am not sure
>> the Mpeg3Plugin is by default in any VM I have.
>
> I see the Mpeg3Plugin in the Plugins folder. I know I had this working at
> some point. Maybe the mp3 plugin has deteriorated in newer VMs? Maybe I'll
> dig up an older VM and see…

the thing is that I compiled that plugin but I never tested it… so there is a good chance it is not working properly and since nobody tried until now, we weren’t aware :(

Esteban

>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Music-in-Pharo-tp4835737p4835901.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>