libsf3
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
sf3_audio.h File Reference
#include "sf3_core.h"
Include dependency graph for sf3_audio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sf3_audio
 

Macros

#define SF3_FORMAT_ID_AUDIO   0x02
 The format_id for an audio file.
 

Enumerations

enum  sf3_audio_format {
  SF3_SAMPLE_ALAW = 0x01 , SF3_SAMPLE_INT16 = 0x02 , SF3_SAMPLE_INT32 = 0x04 , SF3_SAMPLE_INT64 = 0x08 ,
  SF3_SAMPLE_ULAW = 0x11 , SF3_SAMPLE_UINT16 = 0x12 , SF3_SAMPLE_UINT32 = 0x14 , SF3_SAMPLE_UINT64 = 0x18 ,
  SF3_SAMPLE_FLOAT16 = 0x22 , SF3_SAMPLE_FLOAT32 = 0x24 , SF3_SAMPLE_FLOAT64 = 0x28
}
 The possible audio sample formats. More...
 

Functions

SF3_INLINE int sf3_audio_sample_size (const struct sf3_audio *audio)
 Returns the number of bytes per audio sample.
 
SF3_INLINE int sf3_audio_frame_size (const struct sf3_audio *audio)
 Returns the number of bytes per audio frame.
 
SF3_INLINE int sf3_audio_sample_count (const struct sf3_audio *audio)
 Returns the total number of samples of audio stored.
 
SF3_INLINE float sf3_audio_duration (const struct sf3_audio *audio)
 Returns the duration of the audio data in seconds.
 
SF3_EXPORT char * sf3_audio_format (enum sf3_audio_format format)
 Returns a string descriptor of the format type.
 
SF3_EXPORT size_t sf3_audio_size (const struct sf3_audio *audio)
 Computes the size of the audio file in bytes.
 

Macro Definition Documentation

◆ SF3_FORMAT_ID_AUDIO

#define SF3_FORMAT_ID_AUDIO   0x02

The format_id for an audio file.

Definition at line 6 of file sf3_audio.h.

Enumeration Type Documentation

◆ sf3_audio_format

The possible audio sample formats.

Enumerator
SF3_SAMPLE_ALAW 

The audio is stored as bytes encoded in the "A-law" scheme.

SF3_SAMPLE_INT16 

The audio is stored as 16-bit signed PCM.

SF3_SAMPLE_INT32 

The audio is stored as 32-bit signed PCM.

SF3_SAMPLE_INT64 

The audio is stored as 64-bit signed PCM.

SF3_SAMPLE_ULAW 

The audio is stored as bytes encoded in the "u-law" scheme.

SF3_SAMPLE_UINT16 

The audio is stored as 16-bit unsigned PCM.

SF3_SAMPLE_UINT32 

The audio is stored as 32-bit unsigned PCM.

SF3_SAMPLE_UINT64 

The audio is stored as 64-bit unsigned PCM.

SF3_SAMPLE_FLOAT16 

The audio is stored as 16-bit IEEE half-precision floats.

SF3_SAMPLE_FLOAT32 

The audio is stored as 32-bit IEEE single-precision floats.

SF3_SAMPLE_FLOAT64 

The audio is stored as 64-bit IEEE double-precision floats.

Definition at line 9 of file sf3_audio.h.

Function Documentation

◆ sf3_audio_duration()

SF3_INLINE float sf3_audio_duration ( const struct sf3_audio audio)

Returns the duration of the audio data in seconds.

Definition at line 70 of file sf3_audio.h.

◆ sf3_audio_format()

SF3_EXPORT char * sf3_audio_format ( enum sf3_audio_format  format)

Returns a string descriptor of the format type.

Definition at line 75 of file sf3_audio.h.

◆ sf3_audio_frame_size()

SF3_INLINE int sf3_audio_frame_size ( const struct sf3_audio audio)

Returns the number of bytes per audio frame.

Definition at line 60 of file sf3_audio.h.

◆ sf3_audio_sample_count()

SF3_INLINE int sf3_audio_sample_count ( const struct sf3_audio audio)

Returns the total number of samples of audio stored.

Definition at line 65 of file sf3_audio.h.

◆ sf3_audio_sample_size()

SF3_INLINE int sf3_audio_sample_size ( const struct sf3_audio audio)

Returns the number of bytes per audio sample.

Definition at line 55 of file sf3_audio.h.

◆ sf3_audio_size()

SF3_EXPORT size_t sf3_audio_size ( const struct sf3_audio audio)

Computes the size of the audio file in bytes.

Definition at line 93 of file sf3_audio.h.