audio?
Posted: Wed Nov 27, 2013 7:55 pm
has anyone managed to get the 'Play[]' function to work on the pi?
A small, affordable computer with free resources to help people learn, make things, and have fun
https://www.raspberrypi.org/forums/
https://www.raspberrypi.org/forums/viewtopic.php?f=94&t=61944
Code: Select all
Play[Sin[440 2 Pi t], {t, 0, 1}]Code: Select all
pi@pi ~/python $ wolfram
Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information & help: wolfram.com/raspi
In[1]:= Play[Sin[440 2 Pi t], {t, 0, 1}]
Out[1]= Sound[SampledSoundFunction[CompiledFunction[{Play`Time3},
> Block[{t = 0. + 0.000125 Play`Time3}, (Sin[440 2 Pi t] + 0.) 1.],
> -CompiledCode-], 8000, 8000]]
In[2]:=What you have here is a sound object. Play produces a sound object in Mathematica but EmitSound[] actually plays the sound. Sound is under very active development right now so the playback of waveform audio does not currently function as documented in the initial release. In its current incarnation, it should be able to play certain types of sound if there is a FrontEnd available (i.e. X is running). If you use Speak[] (http://reference.wolfram.com/language/ref/Speak.html) with speakers connected, you should hear speech, for instance. Also, SoundNote[] objects should be able to play from the FrontEnd (MIDI sounds). You should expect waveform audio (EmitSound applied to sound objects produced with Play[]) to work as documented in an update soon.DougieLawson wrote:When I tried it in a command window I got this:I've not tried transcribing that back into Mathematica.Code: Select all
pi@pi ~/python $ wolfram Wolfram Language (Raspberry Pi Pilot Release) Copyright 1988-2013 Wolfram Research Information & help: wolfram.com/raspi In[1]:= Play[Sin[440 2 Pi t], {t, 0, 1}] Out[1]= Sound[SampledSoundFunction[CompiledFunction[{Play`Time3}, > Block[{t = 0. + 0.000125 Play`Time3}, (Sin[440 2 Pi t] + 0.) 1.], > -CompiledCode-], 8000, 8000]] In[2]:=