AudioType
Details
- Possible types returned by AudioType are:
-
"SignedInteger8" signed 8-bit integers from
through 
"SignedInteger16" signed 16-bit integers from
through 
"SignedInteger32" signed 32-bit integers from
through 
"Real32" single-precision real (32-bit) "Real64" double-precision real (64-bit)
Examples
open all close allBasic Examples (3)
Extract the type of an audio object:
AudioType[\!\(\*AudioBox[""]\)]AudioType[\!\(\*AudioBox[""]\)]An out-of-core audio object always assumes a "Real32" type:
AudioType[\!\(\*AudioBox[""]\)]Scope (6)
Generate an audio object of type "SignedInteger8":
Audio[Range[1, 40000], "SignedInteger8", SampleRate -> 8000]AudioType[%]Audio[RandomInteger[{-100, 100}, 8000], "SignedInteger16", SampleRate -> 8000]AudioType[%]A "Real32" audio object:
Audio[{1, 2, 3, 4}, "Real32", SampleRate -> 8000]AudioType[%]Use the Audio construct to convert an audio object to a different type:
a1 = Import["ExampleData/rule30.wav"];
a2 = Audio[a1, "SignedInteger8"];AudioType /@ {a1, a2}Compare the byte counts of different data types:
types = {"SignedInteger8", "SignedInteger16", "SignedInteger32", "Real32", "Real64"};
bytes = Table[ByteCount[AudioGenerator["Sin", 5, t]], {t, types}];TextGrid[Transpose[{types, bytes}], Frame -> All]The byte count of an out-of-core audio object does not increase for larger data types:
a = AudioGenerator["Sin", 5];Export["file16.wav", a, "AudioEncoding" -> "Integer16"]Export["file32.wav", a, "AudioEncoding" -> "Integer32"]The byte counts of the stored files are different:
FileByteCount /@ {"file16.wav", "file32.wav"}The byte counts of out-of-core audio objects are the same:
ByteCount /@ {Audio["file16.wav"], Audio["file32.wav"]}Possible Issues (1)
An out-of-core audio object supports only a "Real32" type:
Import["ExampleData/sample.flac", "AudioEncoding"]AudioType[Audio["ExampleData/sample.flac"]]The type of the imported audio is the same as what is stored in the file:
AudioType[Import["ExampleData/sample.flac"]]See Also
Audio AudioSampleRate Duration AudioData AudioChannels AudioQ
Related Guides
Text
Wolfram Research (2016), AudioType, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioType.html (updated 2019).
CMS
Wolfram Language. 2016. "AudioType." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/AudioType.html.
APA
Wolfram Language. (2016). AudioType. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioType.html
BibTeX
@misc{reference.wolfram_2026_audiotype, author="Wolfram Research", title="{AudioType}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/AudioType.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_audiotype, organization={Wolfram Research}, title={AudioType}, year={2019}, url={https://reference.wolfram.com/language/ref/AudioType.html}, note=[Accessed: 12-June-2026]}