AudioPlay
✖
AudioPlay
Details and Options

- AudioPlay can be used to perform programmatic audio playback.
- In AudioPlay[audio], AudioOutputDevice and SoundVolume are inherited from audio.
- AudioPlay will continually change the "Position" property of astream starting from the current position.
- If astream is connected to an input device, AudioPlay plays the current signal being captured.
- AudioPlay by default plays the entire stream until paused, stopped or finished.
- The following options can be specified:
-
Looping Automatic whether to loop the playback MaxDuration Infinity maximum playback duration - AudioPlay continues to play until either MaxDuration is reached or the maximum number of loops is played.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Create an AudioStream object and start the playback:

https://wolfram.com/xid/0enzwb91m-8sgxqm

Scope (4)Survey of the scope of standard use cases
Play an existing AudioStream object:

https://wolfram.com/xid/0enzwb91m-tt4snl


https://wolfram.com/xid/0enzwb91m-e0cie8

Create two separate streams from an audio object:

https://wolfram.com/xid/0enzwb91m-yj6vpv

https://wolfram.com/xid/0enzwb91m-fbcs6a
The two streams are independent. Play one after 0.5 seconds from the beginning of the other one:

https://wolfram.com/xid/0enzwb91m-2d9hmz
Create a stream from a list of audio objects:

https://wolfram.com/xid/0enzwb91m-iudd01

https://wolfram.com/xid/0enzwb91m-sxfips


https://wolfram.com/xid/0enzwb91m-4u8amh

Generate an infinite audio stream from a function:

https://wolfram.com/xid/0enzwb91m-kjmpkw


https://wolfram.com/xid/0enzwb91m-7nbova


https://wolfram.com/xid/0enzwb91m-6f3ykz
Options (2)Common values & functionality for each option
Looping (1)
MaxDuration (1)
By default, MaxDuration is ∞:

https://wolfram.com/xid/0enzwb91m-dj95tb

Play only the first two seconds:

https://wolfram.com/xid/0enzwb91m-mqp8vh

Wolfram Research (2017), AudioPlay, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPlay.html (updated 2020).
Text
Wolfram Research (2017), AudioPlay, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPlay.html (updated 2020).
Wolfram Research (2017), AudioPlay, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPlay.html (updated 2020).
CMS
Wolfram Language. 2017. "AudioPlay." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/AudioPlay.html.
Wolfram Language. 2017. "AudioPlay." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/AudioPlay.html.
APA
Wolfram Language. (2017). AudioPlay. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioPlay.html
Wolfram Language. (2017). AudioPlay. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioPlay.html
BibTeX
@misc{reference.wolfram_2025_audioplay, author="Wolfram Research", title="{AudioPlay}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/AudioPlay.html}", note=[Accessed: 23-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_audioplay, organization={Wolfram Research}, title={AudioPlay}, year={2020}, url={https://reference.wolfram.com/language/ref/AudioPlay.html}, note=[Accessed: 23-April-2025
]}