Message Boards Message Boards

1
|
2212 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Play Two Files in a Sequence?

Posted 1 year ago

Hello,

Forgive me if this is a very amateur question, but I’m trying to figure out how to make two audio files from File Explorer play in a sequence. In the Wolfram Reference guide, the code is as follows for playing two sounds in a sequence:

Sound[{Play[Sin[1000 t], {t, 0, 1}], Play[Sin[2000 t], {t, 0, 1}]}]

I was attempting to play two audio files from File Explorer and make them play in a sequence, so I did the following (short-cutting the file path locations so the code doesn’t take up too much of my post):

Sound[{Play[Audio[“Downloads/Music/Wilhelm Kempf/Moonlight Sonata”, Play[Audio[“
Downloads/Music/Johann Pachelbel/Canon in D”]]]]}]

But this isn’t working for me. Wolfram keeps telling me that Play needs two arguments, and I’m only giving it one.

Any help is very appreciated, thanks.

2 Replies

Hey Rohit,

Thank you very much for your help.

Hi Eleazar,

For audio files, use Audio, AudioJoin and AudioPlay. E.g.

AudioPlay@AudioJoin[
  Audio[File["ExampleData/car.mp3"]],
  Audio["http://exampledata.wolfram.com/bach.mp3"]]
POSTED BY: Rohit Namjoshi
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