Message Boards Message Boards

Export a Stereo MP3 sound file?

Posted 8 years ago

Hi everyone, Have just installed Mathematica 11 on desktop PC.

I'm trying to generate a stereo mp3 sound file as an output of generating binaural beat frequencies (refer to the Demonstration notebook called “Binaural Beats). Left channel is Frequency 1 and right channel is Frequency 2. Time duration is up to 8 hours (play the sound via ear phones while sleeping).

Pressing the "Play" button in the demonstration program generates the stereo sound, but I need to record it to an mp3 file. I tried inserting "Export [sound.mp3, %]" in the code but nothing happens. Where is the sound file stored/written to ? I've searched the Help documentation but couldn't find anything.

Thanks in advance. Nuri

POSTED BY: Nuri Chorvat
4 Replies
Posted 8 years ago

Have added an extra button to just do the Export (as suggested) with no syntax errors highlighted, but doesn't show the new button or generate the mp3 sound file. Where have I gone wrong ?

Attachments:
POSTED BY: Nuri Chorvat

try first to set the current working directory:

SetDirectory[NotebookDirectory[]]

then it should export it to the same folder as your notebook. The default is Directory[].

Have you tried first a 10-second version? before going to 8 hours? 8 hours needs roughly 8360044100 samples: 1.3 billion! which is quite a lot...

POSTED BY: Sander Huisman
Posted 8 years ago

Sander, Thanks. Yes. I'm only testing using 10 second samples. Have attached the draft notebook showing code. My syntax is probably incorrect.

Attachments:
POSTED BY: Nuri Chorvat

% is not used correctly, also "sound.mp3" should be between double quotes, like I just did. Make another Button that does the Export, now you have a Column with Export in it, does not make much sense...

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract