[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.39 Sounds

Procedures for sounds. Please (use sound) if you wish to use these procedures.

Function: make-audio-format encoding sample-rate sample-size-in-bits channels frame-size frame-rate endianness

creates a audio format object.

encodingspecifies an encoding by a symbol shown as follows.
  • alaw: a-law
  • pcm-signed: signed linear PCM
  • pcm-unsigned: unsigned linear PCM
  • ulaw: u-law
sample-ratespecifies sampling frequency(Hz).
sample-size-in-bitsspecifies sampling bits.
channelsspecifies number of channels (monoral: 1, stereo: 2).
frame-sizespecifies bytes of the frames.
frame-ratespecifies frames per second.
endiannessspecifies endianness. this must be a symbol big-endian or little-endian.
Function: make-target-data-line audio-format

creates a target(input) data line.

Function: make-source-data-line audio-format

creates a source(output) data line.

Function: open-data-line data-line

creates a data line.

Function: start-data-line data-line

starts the data line and data will be transfered from the device.

Function: stop-data-line data-line

stops transferring the data line.

Function: flush-data-line data-line

flushs the data line.

Function: close-data-line data-line

closes the data line.

Function: read-data-line-relative target-data-line sample-num

reads data from the target data line.
Intensity is normalized by maximum value and each value is in [0, 1.0](unsigned) or [-1.0 1.0](signed).
The result is returned as f32 uniform vector (see SRFI-4).
This procedure returns one value(monoral) or two values(stereo).

Function: write-data-line-relative source-data-line data-to-write […]

writes data to the source data line.
Intensity is normalized by maximum value and each value is in [0, 1.0](unsigned) or [-1.0 1.0](signed).
Data must be an f32 uniform vector (see SRFI-4).
This procedure requires one argument(monoral) or two arguments(stereo).

Function: make-playable sound-file-name repeat

creates a sound playable object.
Format of the sound file depends on your Java environment. WAV file format is available in the Java standard environment. MP3 file is available if you use an MP3 plug-in.
repeat specifies times when the sound file is played. If repeat is #f the sound file is played eternally.

Function: play-sound playable

plays the sound object.

Function: stop-play-sound playable

stops the sound object.

Function: pause-play-sound playable

pauses the sound object. To restart playing the sound, you should call procedure play-sound.


[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on August 9, 2012 using texi2html 5.0.