Skip to content

Commit

Permalink
Add some documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare committed Aug 19, 2024
1 parent 0797422 commit 039ee9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions py_src/sphn/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def read(filename, start_sec=None, duration_sec=None, sample_rate=None):
"""
pass

@staticmethod
def read_opus(filename):
"""
Reads the whole content of an ogg/opus encoded file.
This returns a two dimensional array as well as the sample rate.
"""
pass

@staticmethod
def write_wav(filename, data, sample_rate):
"""
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ fn write_wav(
Ok(())
}

/// Reads the whole content of an ogg/opus encoded file.
///
/// This returns a two dimensional array as well as the sample rate.
#[pyfunction]
#[pyo3(signature = (filename))]
fn read_opus(filename: std::path::PathBuf, py: Python) -> PyResult<(PyObject, u32)> {
Expand Down

0 comments on commit 039ee9f

Please sign in to comment.