Define sf_subtype_to_effective_format
This commit is contained in:
parent
7998012015
commit
85eb3dbf46
|
@ -225,6 +225,17 @@ int sf_subtype_bytes_per_sample(unsigned int format){
|
|||
return 2;
|
||||
}
|
||||
|
||||
sampleFormat sf_subtype_to_effective_format(unsigned int format)
|
||||
{
|
||||
unsigned int subtype = format & SF_FORMAT_SUBMASK;
|
||||
if (subtype == SF_FORMAT_PCM_24)
|
||||
return int24Sample;
|
||||
else if (sf_subtype_more_than_16_bits(format))
|
||||
return widestSampleFormat;
|
||||
else
|
||||
return int16Sample;
|
||||
}
|
||||
|
||||
|
||||
FileExtensions sf_get_all_extensions()
|
||||
{
|
||||
|
|
|
@ -102,6 +102,9 @@ bool sf_subtype_more_than_16_bits(unsigned int format);
|
|||
bool sf_subtype_is_integer(unsigned int format);
|
||||
int sf_subtype_bytes_per_sample(unsigned int format);
|
||||
|
||||
//! Choose the narrowest value in the sampleFormat enumeration for a given libsndfile format
|
||||
sampleFormat sf_subtype_to_effective_format(unsigned int format);
|
||||
|
||||
extern FileExtensions sf_get_all_extensions();
|
||||
|
||||
wxString sf_normalize_name(const char *name);
|
||||
|
|
Loading…
Reference in New Issue