After waiting for days for my license I now got the opportunity to install Wolfram Mathematica 8 at home. However, neither the Play nor the Speak functions are doing anything as it seems that Mathematica cannot produce any sound output due to unknown reasons. Might anyone have an idea how I can fix this?

3 Answers
3

Ubuntu uses the PulseAudio sound system. It comes with the paplay command to play a sound file. The approach you found on the Ubuntu wiki should work, but you need to use paplay (or some other equivalent program) rather than the now obsolete aRts.

Here's some code adapted from the Ubuntu wiki. Add it to your ~/.Mathematica/Kernel/init.m or to a file that it includes. In addition to running paplay rather than artsplay, I've changed it to pipe the data rather than store it in a temporary file. Untested.

+1; Although to get it working I had to replace OpenWrite["!paplay"] with OpenWrite["!pacat",BinaryFormat -> True]. Also, you get the normal graphics output if you append a #1 to the end of your $SoundDisplayFunction. Finally, I've updated my answer to further discuss OSS (which Mathematica wants to use) versus ALSA/PA (that Ubuntu uses).
–
SimonJul 8 '11 at 13:07

I get a "Set::wrsym: Symbol $SoundDisplayFunction is Protected." error when starting Mathematica 6.0.2.1. Also, I assume everything after "CODE ENDS" should not be in sound.m, right? thanks
–
GeremiaJan 11 '14 at 2:11

Also, when playing sounds in Mathematica, I get this error (although I hear the sound): «Export::infer: "Cannot infer format of file \!(\"stdout\")."» thanks
–
GeremiaJan 11 '14 at 2:20

Also, is there a similar fix as this for CDF Player?
–
GeremiaJan 11 '14 at 2:26

Also, this solution doesn't seem to work with other functions like FrequencyModulation.
–
GeremiaJan 11 '14 at 2:39