handling AmbiX files
More...
|
| ambix_readf() |
| Read samples from the ambix fileReads samples from an ambix file, possibly expanding a reduced channel set to a full ambisonics set (when reading an 'ambix extended' file as 'ambix basic')
|
|
| ambix_writef() |
| Write samples to the ambix file.Writes samples (as single precision floating point values) to an ambix file, possibly expanding a reduced channel set to a full ambisonics set (when writing an 'ambix extended' file as 'ambix basic').
|
|
handling AmbiX files
Add a new marker to the ambix file.
- Parameters
-
ambix | The handle to an ambix file |
marker | A valid marker that should be added to the ambix file. |
- Returns
- an errorcode indicating success.
Add a new region to the ambix file.
- Parameters
-
ambix | The handle to an ambix file |
region | A valid region that should be added to the ambix file. |
- Returns
- an errorcode indicating success.
Close an ambix handle.
Closes an ambix handle and cleans up all memory allocations associated with it.
- Parameters
-
ambix | The handle to an ambix file |
- Returns
- an error code indicating success
Deletes all markers in the ambix file.
- Parameters
-
ambix | The handle to an ambix file |
- Returns
- an errorcode indicating success.
Deletes all regions in the ambix file.
- Parameters
-
ambix | The handle to an ambix file |
- Returns
- an errorcode indicating success.
Get the adaptor matrix.
The ambix extended fileformat comes with a adaptor matrix, that can be used to reconstruct a full 3d ambisonics set from the channels stored in ambix file. In the ambix AMBIX_BASIC format no adaptor matrix is present, the file always contains the full set.
- Parameters
-
ambix | The handle to an ambix file |
- Returns
- the adaptor matrix to restore the full ambisonics set from the reduced set, or NULL if there is no such matrix; the memory is owned by the library and must neither be freed nor used after calling ambix_close().
Get one marker.
- Parameters
-
ambix | The handle to an ambix file |
id | The id of the marker to retrieve. |
- Returns
- The marker requested or NULL in case the marker does not exist.
Get the number of stored markers within the ambix file.
- Returns
- number of markers.
Get the number of stored regions within the ambix file.
- Parameters
-
ambix | The handle to an ambix file |
- Returns
- Number of regions.
Get one region.
- Parameters
-
ambix | The handle to an ambix file |
id | The id of the region to retrieve. |
- Returns
- The region requested or NULL in case the region does not exist.
Get the libsndfile handle associated with the ambix handle.
If possible, require an SNDFILE handle if possible; if the ambix handle is not associated with SNDFILE (e.g. because libambix is compiled without libsndfile support), NULL is returned.
- Parameters
-
ambix | The handle to an ambix file |
- Returns
- A libsndfile handle or NULL
Open an ambix file.
Opens a soundfile for reading/writing
- Parameters
-
- Returns
- A handle to the opened file (or NULL on failure)
Reposition the file pointer.
Reposition the file read (and/or write) pointer to a new offset. Consecutive calls to ambix_readf() (resp. ambix_writef()) will read (resp. write) from the new position.
- Parameters
-
ambix | The handle to an ambix file |
frames | frame offset from the position given in whence |
whence | location from where to seek; if whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. |
- Returns
- the offset in (multichannel) frames from the start of the audio data or -1 if an error occurred.
Set a matrix to be pre-multiplied.
Adds an (additional) adaptor matrix to the processing. Depending on the mode of operation this can have different meanings! When READing an ambix 'AMBIX_BASIC' file, this tells the library to do an (additional) matrix-multiplication When reconstructing the full ambisonics set; you can use this to get the ambisonics channels in a format other than SN3D/ACN (e.g. using an ambix to Furse-Malham adaptor matrix) or getting the loudspeaker feeds directly (by supplying a decoder matrix); in this case, the matrix MUST have ambix->ambichannels columns. When WRITEing an ambix 'AMBIX_EXTENDED' file, this tells the library to store the matrix as the adaptor matrix within the file.
- Parameters
-
ambix | The handle to an ambix file |
matrix | a matrix that will be pre-multiplied to the reconstruction-matrix; can be freed after this call. |
- Returns
- an errorcode indicating success