Documentation

SoundService class documentation

MKSoundDevice <NSObject>

AuthorsGenerated by builder
Declared inMKSoundDevice.h

Default

- (id) initForInput

Initialises a device for input (i.e. as a microphone / line in).

    - (id) initForOutput

    Initialises a device for output (i.e. as a speaker / headphone).

      - (BOOL) recordSample: (void*)bytes count: (int)count

      Records a sample from an input device. Returns true if the read succeeded.

        - (BOOL) playSample: (void*)bytes count: (int)count

        Plays a sample in an output device.

          - (int) setFormat: (int)format

          Sets the current sample format. See the OSS documentation for valid formats.

          Note that this should be called before any calls setting the number of channels or the sample rate.

            - (int) setChannels: (int)channels

            Sets the number of channels to use on this device.

            Note that this must be called before any calls setting the sampling rate and after any setting the sample format.

              - (int) setRate: (int)rate

              Sets the sampling rate in Hertz.

                - (BOOL) setVolumeLeft: (int)left right: (int)right

                Sets the volume for the left and right channels. Valid values are from 0 to 100. Behaviour on other values is undefined.

                  - (int) leftVolume

                  Returns be volume of the left channel.

                    - (int) rightVolume

                    Returns the volume of the right channel.

                      - (int) format

                      Returns the current format.

                        - (void) sync

                        Synchronises this thread with device state. Blocks until all data sent to the device has really been played.

                          - (void) reset

                          Resets the device. The sample format, rate, and number of channels will return to their defaults and can once again be set.