IpatchSndFile

IpatchSndFile — libsndfile file object

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Object Hierarchy

    GEnum
    ╰── IpatchSndFileEndian
    GObject
    ╰── IpatchItem
        ╰── IpatchFile
            ╰── IpatchSndFile

Description

Object type for libsndfile audio file identification.

Functions

ipatch_snd_file_new ()

IpatchSndFile *
ipatch_snd_file_new (void);

Create a new libsndfile file object.

Returns

New libsndfile file object (derived from IpatchFile) with a reference count of 1. Caller owns the reference and removing it will destroy the item.


ipatch_snd_file_format_get_sub_formats ()

int *
ipatch_snd_file_format_get_sub_formats
                               (int format,
                                guint *size);

Get supported sub formats of a given libsndfile format.

Parameters

format

"IpatchSndFileFormat" GEnum to get sub formats of.

[type IpatchSndFileFormat]

size

Location to store size of returned sub formats array.

[out]

Returns

Newly allocated list of sub format enum values or NULL if format is invalid.

[array length=size]


ipatch_snd_file_sample_format_to_sub_format ()

int
ipatch_snd_file_sample_format_to_sub_format
                               (int sample_format,
                                int file_format);

Get the optimal libsndfile sub format for a libinstpatch sample format. The returned value may not be an exact equivalent, in the case of unsigned sample data with bit widths greater than 8, but will return the optimal format in those cases. If file_format is not -1 then the resulting sub format is guaranteed to be valid for it.

Parameters

sample_format

libinstpatch sample format (see sample)

 

file_format

libsndfile format GEnum "IpatchSndFileFormat" value or -1 to not limit sub formats to a given file format.

 

Returns

Optimal libsndfile sub format enum value or -1 on error (invalid sample_format ).

Types and Values

enum IpatchSndFileEndian

Endian byte order libsndfile enum.

Members

IPATCH_SND_FILE_ENDIAN_FILE

Use the default endian for the file format

 

IPATCH_SND_FILE_ENDIAN_LITTLE

Little endian byte order

 

IPATCH_SND_FILE_ENDIAN_BIG

Big endian byte order

 

IPATCH_SND_FILE_ENDIAN_CPU

Native CPU byte order

 

IPATCH_SND_FILE_DEFAULT_FORMAT

#define IPATCH_SND_FILE_DEFAULT_FORMAT     SF_FORMAT_WAV

Default file format enum for IPATCH_TYPE_SND_FILE_FORMAT.


IPATCH_SND_FILE_DEFAULT_SUB_FORMAT

#define IPATCH_SND_FILE_DEFAULT_SUB_FORMAT SF_FORMAT_PCM_16

Default file sub format enum for IPATCH_TYPE_SND_FILE_SUB_FORMAT.


IPATCH_SND_FILE_DEFAULT_ENDIAN

#define IPATCH_SND_FILE_DEFAULT_ENDIAN     IPATCH_SND_FILE_ENDIAN_FILE

Default endian byte order from enum IPATCH_TYPE_SND_FILE_ENDIAN.