# HG changeset patch # User Amine Sehili # Date 1730283458 -3600 # Node ID 97eff033c8f8d39621f9df0d6a4c8b9fdbb04fa1 # Parent 1baa80ec22c3d282d8be2c7a1c317a691bdeeb72 Update README diff -r 1baa80ec22c3 -r 97eff033c8f8 README.rst --- a/README.rst Wed Oct 30 10:47:56 2024 +0100 +++ b/README.rst Wed Oct 30 11:17:38 2024 +0100 @@ -42,7 +42,7 @@ Basic example ------------- -Here's a simple example of using `auditok` to detect audio events: +Here's a simple example of using ``auditok`` to detect audio events: .. code:: python @@ -101,8 +101,8 @@ Split an audio stream and re-join (glue) audio events with silence ------------------------------------------------------------------ -The following detects audio events within an audio stream, then insert -1 second of silence between them to create an audio with pauses. +The following code detects audio events within an audio stream, then insert +1 second of silence between them to create an audio with pauses: .. code:: python @@ -116,13 +116,25 @@ events = split("audio.wav") audio_with_pauses = silence.join(events) -Alternatively, use `split_and_join_with_silence`: +Alternatively, use ``split_and_join_with_silence``: .. code:: python from auditok import split_and_join_with_silence audio_with_pauses = split_and_join_with_silence(silence_duration=1, input="audio.wav") +Export an ``AudioRegion`` as a ``numpy`` array +---------------------------------------------- + +.. code:: python + + from auditok import load, AudioRegion + audio = load("audio.wav") # or use `AudioRegion.load("audio.wav")` + x = audio.numpy() + assert x.shape[0] == audio.channels + assert x.shape[1] == len(audio) + + Limitations -----------