changeset 370:4d9edd170403

Fix documentation
author Amine Sehili <amine.sehili@gmail.com>
date Sun, 10 Jan 2021 22:54:47 +0100
parents 0106c4799906
children 8d3e2b492c6f
files auditok/io.py
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/auditok/io.py	Sun Jan 10 22:36:22 2021 +0100
+++ b/auditok/io.py	Sun Jan 10 22:54:47 2021 +0100
@@ -701,9 +701,9 @@
     Parameters
     ----------
     input : str, bytes, "-" or None (default)
-        source to read audio data from. If str, it should be a path to a valid
-        audio file. If bytes, it is interpreted as raw audio data. If it is "-",
-        raw data will be read from stdin. If None, read audio data from built-in
+        source to read audio data from. If `str`, it should be a path to a valid
+        audio file. If `bytes`, it is used as raw audio data. If it is "-",
+        raw data will be read from stdin. If None, read audio data from the
         microphone using PyAudio.
     kwargs
         audio parameters used to build the `AudioSource` object. Depending on
@@ -868,8 +868,11 @@
     Note that the current implementation supports only wave and raw formats for
     lazy audio loading.
 
-    If an audio format other than `raw` is used then sampling rate, sample width
-    and channels are required.
+    If an audio format is `raw`, the following keyword arguments are required:
+
+        - `sampling_rate`, `sr`: int,  sampling rate of audio data.
+        - `sample_width`, `sw`: int, size in bytes of one audio sample.
+        - `channels`, `ch`: int, number of channels of audio data.
 
     See also
     --------
@@ -980,11 +983,11 @@
         audio data to be written. Can be a `bytes`, `bytearray`,
         `memoryview`, `array` or `numpy.ndarray` object.
     file : str
-        path to output audio file
+        path to output audio file.
     audio_format : str
         audio format used to save data (e.g. raw, webm, wav, ogg)
     kwargs: dict
-        If an audio format other than raw is used, the following keyword
+        If an audio format other than `raw` is used, the following keyword
         arguments are required:
 
         - `sampling_rate`, `sr`: int,  sampling rate of audio data.