Skip to content

Commit 8ee62ec

Browse files
committed
update Api docs
1 parent 3e67ad6 commit 8ee62ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,15 @@ amount. This is particularly useful to plug this stream into an audio device cal
283283
variable number of frames per call.
284284

285285

286+
*function* ``stream_raw_pcm_memory (pcmdata: Union[array.array, memoryview, bytes], nchannels: int, sample_width: int) -> Generator[Union[bytes, array.array], int, NoneType]``
287+
> Convenience generator function to stream raw pcm audio data from memory. Usually you don't need to
288+
use this as the library provides many other streaming options that work on much smaller, encoded,
289+
audio data. However in the odd case that you only have already decoded raw pcm data you can use this
290+
generator as a stream source. The data can be provided in ``array`` type or ``bytes``,
291+
``memoryview`` or even a numpy array. Be sure to also specify the correct number of channels that
292+
the audio data has, and the sample with in bytes.
293+
294+
286295
*function* ``vorbis_get_file_info (filename: str) -> miniaudio.SoundFileInfo``
287296
> Fetch some information about the audio file (vorbis format).
288297
@@ -347,6 +356,10 @@ stream_file() instead.
347356
> Writes the pcm sound to a WAV file
348357
349358

359+
*function* ``width_from_format (sampleformat: miniaudio.SampleFormat) -> int``
360+
> returns the sample width in bytes, of the given sample format.
361+
362+
350363
*class* ``CaptureDevice``
351364

352365
``CaptureDevice (self, input_format: miniaudio.SampleFormat = <SampleFormat.SIGNED16: 2>, nchannels: int = 2, sample_rate: int = 44100, buffersize_msec: int = 200, device_id: Optional[_cffi_backend._CDataBase] = None, callback_periods: int = 0, backends: Optional[List[miniaudio.Backend]] = None, thread_prio: miniaudio.ThreadPriority = <ThreadPriority.HIGHEST: 0>, app_name: str = '') ``

0 commit comments

Comments
 (0)