Package com.io7m.jsamplebuffer.xmedia
Class SXMSampleBuffers
java.lang.Object
com.io7m.jsamplebuffer.xmedia.SXMSampleBuffers
Functions to create buffers from audio streams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SampleBufferTypesampleBufferOfFile(Path file, SampleBufferFactoryType buffers) Read the given file into a sample buffer.static SampleBufferTypesampleBufferOfStream(AudioInputStream stream, SampleBufferFactoryType buffers) Read the given stream into a sample buffer.static AudioInputStreamProduce a stream from the given sample buffer.
-
Method Details
-
sampleBufferOfFile
public static SampleBufferType sampleBufferOfFile(Path file, SampleBufferFactoryType buffers) throws IOException, UnsupportedAudioFileException Read the given file into a sample buffer.- Parameters:
file- The filebuffers- A provider of buffers- Returns:
- A sample buffer
- Throws:
IOException- On I/O errorsUnsupportedAudioFileException- If the file refers to an audio format that cannot be processed
-
sampleBufferOfStream
public static SampleBufferType sampleBufferOfStream(AudioInputStream stream, SampleBufferFactoryType buffers) throws IOException, UnsupportedAudioFileException Read the given stream into a sample buffer.- Parameters:
stream- The streambuffers- A provider of buffers- Returns:
- A sample buffer
- Throws:
IOException- On I/O errorsUnsupportedAudioFileException- If the audio stream refers to an audio format that cannot be processed
-
streamOfSampleBuffer
Produce a stream from the given sample buffer.- Parameters:
sample- The sample buffer- Returns:
- A stream
-