Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to import sound from a file, record, and import sound.

  (*Audio Import Browse*)
  Audiopath1 = 
    FileNameJoin[{$UserDocumentsDirectory, "Audio.wav"}]}, 
  Column["Audio File (.wav) " 
    {Row[{InputField[Dynamic[Audiopath1], String, Enabled -> False], 
       FileNameSetter[Dynamic[Audiopath1], "Open", {".wav" -> {"*.wav"}}]}]}],
 (*Audio Record*)"Audio \Record", 
 Button["Record", Sound[SystemDialogInput["RecordSound"]]]]
share|improve this question
For import of sound files, try ?Import for exporting, try ?Export for recording, see this thread… – bill s Apr 23 '13 at 10:58
Do you mean "I want to import sound from a file, record, and export sound."? – m_goldberg Apr 23 '13 at 13:40
If I click browse button, It will Import sound from file. If I click a record button, It will record sound and show the waveform – Oropher Telemna Apr 24 '13 at 6:48

You have to use Method -> "Queued" to make the frontend to wait for the input from the sound recorder before finishing dynamic evaluation:

DynamicModule[{input = "ExampleData/rule30.wav", sound = ""},
    Row@{"Record: ", Button["Record", sound = SystemDialogInput@"RecordSound", 
       Method -> "Queued"], Button["Reset", sound = ""]},
    Row@{"Import: ",
            (input = #; If[(input =!= $Failed \[Or] input =!= $Canceled) && 
            FileExistsQ@input, sound = Import@input]) &], "Open",
            {".wav" -> {"*.wav"}, ".*" -> {"*.*"}}],
         InputField[Dynamic[input], String, Enabled -> False]},

Mathematica graphics

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.