music_prob and speech_prob are independent, not a split of 100%. A singer over a backing track scores high on both at once.
This is not AI Music Detection, which answers whether music was model-generated. See AI Music Detection.
Music & Speech Detection (batch)
Returnsapplication/json. Every field is always present.
Note that duration here is
duration_s in seconds. Most other Modulate endpoints report duration_ms.
Try it
Output
Response
Response
frames is abridged above. A 5.76 second clip returns all 30 of its 192 ms frames.What you can configure
Audio formats
Accepted extensions include.mp3, .wav, .flac, .m4a, .mp4, .ogg, .opus, .webm, .aac, .aiff, and .mov, plus 85 others.
All 96 accepted extensions
All 96 accepted extensions
.3g2, .3ga, .3gp, .3gpp, .8svx, .aa3, .aac, .ac3, .act, .adts, .aif,
.aifc, .aiff, .alac, .amb, .amr, .ape, .asf, .at3, .au, .avi, .avr,
.awb, .bwf, .c2, .caf, .dss, .dts, .dtshd, .eac3, .ec3, .f4a, .f4b,
.flac, .flv, .gsm, .iff, .m2a, .m2ts, .m4a, .m4b, .m4r, .m4v, .mka,
.mkv, .mlp, .mmf, .mov, .mp+, .mp1, .mp2, .mp3, .mp4, .mpa, .mpc, .mpeg,
.mpg, .mpga, .mpp, .mts, .mxf, .nist, .oga, .ogg, .ogx, .oma, .omg,
.opus, .paf, .pvf, .qcp, .ra, .rf64, .rka, .rm, .rmvb, .sf, .shn, .snd,
.sph, .svx, .tak, .thd, .ts, .tta, .vob, .voc, .vqf, .w64, .wav,
.wave, .weba, .webm, .wma, .wmv, .wv400.
Music & Speech Detection (streaming)
Oneframe message per completed 192 ms window, then a done message carrying clip totals computed across everything received.
Note that
done reports duration_ms in milliseconds, where the batch response reports duration_s in seconds.
Send audio as binary WebSocket frames of any size; the server buffers and windows internally. Send an empty text frame ("") to end the stream. The server then flushes remaining audio, delivers final frames, sends done, and closes.
Try it
Output
frame line is printed per 192 ms of audio, so a 15 second clip prints 80 of them before done.
Messages received
Messages received
curl and websocat cannot close a stream cleanly. Use one of the clients above.
What you can configure
Audio formats
Container formats. Accepted values includemp3, wav, flac, m4a, mp4, ogg, opus, webm, aac, aiff, wma, amr, and au, plus 66 others. The stream header carries sample rate and channel count, so sample_rate and num_channels are ignored if supplied.
All 79 accepted container values
All 79 accepted container values
3g2, 3ga, 3gp, 3gpp, 8svx, aa3, aac, ac3, act, adts, aif, aifc, aiff,
amb, amr, asf, at3, au, avr, awb, bwf, c2, caf, dss, dts, dtshd,
eac3, ec3, f4a, f4b, flac, gsm, iff, m2a, m2ts, m4a, m4b, m4r, m4v,
mka, mkv, mlp, mp+, mp1, mp2, mp3, mp4, mpa, mpc, mpga, mpp, mts,
oga, ogg, ogx, oma, omg, opus, paf, pvf, qcp, ra, rf64, rm, rmvb,
snd, svx, thd, ts, tta, voc, vqf, w64, wav, wave, weba, webm, wma,
wmvmp4, m4a, m4b, m4r, m4v, 3gp, 3gpp, 3ga, 3g2, f4a, f4b) must be sent in a streamable layout. Anything else ends the connection with an audio-processing error.
Raw formats. s8, s16le, s16be, s24le, s24be, s32le, s32be, u8, u16le, u16be, u24le, u24be, u32le, u32be, f32le, f32be, f64le, f64be, mulaw, alaw, g722, vox. These are headerless, so sample_rate and num_channels are both required. g722 and vox are mono-only: num_channels must be 1.
sample_rate accepts 8000, 11025, 16000, 22050, 32000, 44100, 48000, 96000.
Common raw configurations:
To convert a file to raw PCM:
1003, and again while decoding, closing with 4002. The second catches undecodable audio and a mismatch between the declared audio_format and the bytes sent.