eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SoundStream::DevAudio':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: DevAudio (private in SoundStream

This class is only visible from within SoundStream.

Inheritance:

   Object
   |
   +--Stream
      |
      +--PeekableStream
         |
         +--PositionableStream
            |
            +--WriteStream
               |
               +--ReadWriteStream
                  |
                  +--ExternalStream
                     |
                     +--FileStream
                        |
                        +--SoundStream
                           |
                           +--SoundStream::DevAudio

Package:
stx:libbasic2
Category:
Streams-External
Owner:
SoundStream

Description:


interface to /dev/audio (sun, hpux, linux, ...)


Class protocol:

default values
o  defaultSampleRate
minimum, supported by all audio systems

queries
o  isSupported
SoundStream::DevAudio isSupported
SoundStream::PortAudio isSupported


Instance protocol:

misc
o  dumpSettings
debugging interface - dump the current settings

Usage example(s):

     self writing dumpSettings; close

o  flush
wait until all sound has been played

open & close
o  closeFile
a stream has been collected - close the file

o  openWithMode: aMode attributes: attributeSpec
normally not reached

private
o  initialize
initialize for least common mode

o  resetSoundCard
debugging interface - reset the soundCard

Usage example(s):

     self writing resetSoundCard; dumpSettings; close

o  setAudioFormat: aSymbol
set the format of the audio data as specified by aSymbol.
Returns true if sucessful - may fail with some formats on many sound devices.

Usage example(s):

     self writing dumpSettings; close
     self writing setAudioFormat:#'MU_LAW'; close
     self writing setAudioFormat:#'U8'; dumpSettings; close
     self writing setAudioFormat:#'MPEG'; dumpSettings; close

o  setChannels: nChannels
set the number of channels (1 -> mono; 2 -> stereo).
Returns true if sucessful - may fail with many sound devices.

Usage example(s):

     self writing setChannels:2; dumpSettings; close
     self writing setChannels:2; setSampleRate:10000; dumpSettings; close
     self writing setChannels:2; setSampleRate:40000; dumpSettings; close

o  setFragmentSize: blockSize
set the soundDriver's fragmentSize

o  setSampleRate: hz
set the sample rate

Usage example(s):

     self writing setSampleRate:10000; dumpSettings; close
     self writing setSampleRate:1000; dumpSettings; close
     self writing setSampleRate:8000; dumpSettings; close

queries
o  supportedAudioFormats
return a collection of supported audio formats.
possibly returned symbols are:
U8 unsigned 8bit samples
S8 signed 8bit samples
U16 unsigned 16bit samples in native format
U16_LE unsigned 16bit big endian samples
U16_BE unsigned 16bit big endian samples
S16 signed 16bit little endian samples in native format
S16_LE signed 16bit little endian samples
S16_BE signed 16bit big endian samples
S24 signed 24bit little endian samples in native format
S24_LE signed 24bit little endian samples
S24_BE signed 24bit big endian samples
S32 signed 32bit little endian samples in native format
S32_LE signed 32bit little endian samples
S32_BE signed 32bit big endian samples
F16 float samples
F32 float samples
MPEG audio mpeg encoded
MU_LAW u-law encoded 8bit samples
A_LAW a-law encoded 8bit samples
IMA_ADPCM adpcm encoded
the set of returned symbols depends on the underlying sound hardware.

Usage example(s):

     |s formats|

     s := self writing.
     formats := s supportedAudioFormats.
     s close.
     formats

reading
o  nextBytes: count into: anObject startingAt: start
read the next count bytes into an object and return the number of
bytes read or nil on error.
Use with ByteArrays only.

writing
o  nextPutBytes: count from: anObject startingAt: start
write count bytes from an object starting at index start.
return the number of bytes written or nil on error.
Redefined, since IRIS audio library cannot be used with stdio.
(at least I don't know). Use with ByteArrays only.



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sun, 22 Dec 2024 03:30:09 GMT