diff README.rst @ 429:97eff033c8f8

Update README
author Amine Sehili <amine.sehili@gmail.com>
date Wed, 30 Oct 2024 11:17:38 +0100
parents 1baa80ec22c3
children 81bc2375354f
line wrap: on
line diff
--- 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
 -----------