de.sciss.synth.io

AudioFile

object AudioFile

The AudioFile allows reading and writing of sound files. It can operate both on a RandomAccessFile created from a File instance, or on an kind of InputStream (not every codec will support this though, and functionality might be limited, for example seeking is not possible with a plain InputStream).

The codecs are registered with AudioFileType. The codecs that come with ScalaAudioFile are found in the impl package.

Reading and writing data requires a user-buffer which holds de-interleaved floating point data, that is a two dimensional Array which holds Float data. A type alias Frames is provided for this, and two helper methods buffer: one static to construct an arbitrary user-buffer, one in class AudioFile which creates a buffer with the appropriate channel number.

Version

0.14, 07-Oct-10

To do

the copyTo method uses a user-buffer. it should check for the possibility to directly transfer data if input and output are compatible.

,

openWrite is currently missing the goodies of ScissLib are missing, e.g. support for markers, comments, app-code.

See also

AudioFileType

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AudioFile
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def buffer(numChannels: Int, bufFrames: Int = 8192): Frames

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. def identify(dis: DataInputStream): Option[AudioFileType]

    Annotations
    @throws( classOf[ IOException ] )
  15. def identify(f: File): Option[AudioFileType]

    Determines the type of audio file.

    Determines the type of audio file.

    f

    the pathname of the file

    returns

    the type code as defined in AudioFileInfo, e.g. TYPE_AIFF. Returns TYPE_UNKNOWN if the file could not be identified.

    Annotations
    @throws( classOf[ IOException ] )
    Exceptions thrown
    IOException

    if the file could not be reader

  16. def identify(path: String): Option[AudioFileType]

    Annotations
    @throws( classOf[ IOException ] )
  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def openRead(is: InputStream): AudioFile

    Annotations
    @throws( classOf[ IOException ] )
  22. def openRead(f: File): AudioFile

    Opens an audio file for reading.

    Opens an audio file for reading.

    f

    the path name of the file

    returns

    a new AudioFile object whose header is already parsed and can be obtained through the getDescr method.

    Annotations
    @throws( classOf[ IOException ] )
    Exceptions thrown
    IOException

    if the file was not found, could not be reader or has an unknown or unsupported format

  23. def openRead(path: String): AudioFile

    Annotations
    @throws( classOf[ IOException ] )
  24. def openWrite(os: OutputStream, spec: AudioFileSpec): AudioFile

    Annotations
    @throws( classOf[ IOException ] )
  25. def openWrite(f: File, spec: AudioFileSpec): AudioFile

    Opens an audiofile for reading/writing.

    Opens an audiofile for reading/writing. The pathname is determined by the file field of the provided AudioFileInfo. If a file denoted by this path already exists, it will be deleted before opening.

    Note that the initial audio file header is written immediately. Special tags for the header thus need to be set in the AudioFileInfo before calling this method, including markers and regions. It is not possible to writer markers and regions after the file has been opened (since the header size has to be constant).

    f

    the path name of the file.

    spec

    format and resolution of the new audio file. the header is immediately written to the harddisc

    Annotations
    @throws( classOf[ IOException ] )
    Exceptions thrown
    IOException

    if the file could not be created or the format is unsupported

  26. def openWrite(path: String, spec: AudioFileSpec): AudioFile

    Annotations
    @throws( classOf[ IOException ] )
  27. def readSpec(dis: DataInputStream): AudioFileSpec

    Note that this method advances in the provided input stream, its previous position is not reset.

    Note that this method advances in the provided input stream, its previous position is not reset.

    Annotations
    @throws( classOf[ IOException ] )
  28. def readSpec(f: File): AudioFileSpec

  29. def readSpec(path: String): AudioFileSpec

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from AnyRef

Inherited from Any

Ungrouped