mp3in — Reads stereo audio data from an external MP3 file.


Reads stereo audio data from an external MP3 file.


ar1, ar2 mp3in ifilcod[, iskptim, iformat, iskipinit, ibufsize]


ifilcod -- integer or character-string denoting the source soundfile name. An integer denotes the file soundin.filcod ; a character-string (in double quotes, spaces permitted) gives the filename itself, optionally a full pathname. If not a full path, the named file is sought first in the current directory, then in that given by the environment variable SSDIR (if defined) then by SFDIR.

iskptim (optional) -- time in seconds of input sound to be skipped. The default value is 0.

iformat (optional) -- specifies the audio data file format: currently not implemented and always defaults to stereo.

iskipinit (optional) -- switches off all initialisation if non zero (default =0).

ibuffersize (optional) -- sets the internal buffer size for reading. If the value is omitted, zero or negative it defaults to 4096 bytes.


Reads stereo audio data from an external MP3 file.


Here is an example of the mp3in opcode. It uses the file mp3in.csd.

Example 452. Example of the mp3in opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

; Select audio/midi flags here according to platform
-odac    ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o mp3in.wav -W ;;; for file output any platform

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

iskptim	 = .3
ibufsize = 64
ar1, ar2 mp3in "beats.mp3", iskptim, 0, 0, ibufsize
         outs ar1, ar2


i 1 0 2

See Also

diskin, ins, in, inh, inh, ino, inq, mp3len, soundin


Author: John ffitch
Codemist Ltd

New in version 5.11