diff options
author | Max Kellermann <max@duempel.org> | 2011-10-08 10:25:06 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-10-20 02:32:39 +0200 |
commit | 545685bc3209d9cfdf6c4b9aeee4715edd453dc1 (patch) | |
tree | a8c1eea32702dcb319bae836581f1938c8bc6152 /src/audio_format.h | |
parent | 13ad2b4dc2a11ab7bad3703cdca050dd55243b6b (diff) | |
download | mpd-545685bc3209d9cfdf6c4b9aeee4715edd453dc1.tar.gz mpd-545685bc3209d9cfdf6c4b9aeee4715edd453dc1.tar.xz mpd-545685bc3209d9cfdf6c4b9aeee4715edd453dc1.zip |
audio_format: basic support for floating point samples
Support for conversion from float to 16, 24 and 32 bit integer
samples.
Diffstat (limited to 'src/audio_format.h')
-rw-r--r-- | src/audio_format.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/audio_format.h b/src/audio_format.h index 71bd369e9..4f7dbfb1a 100644 --- a/src/audio_format.h +++ b/src/audio_format.h @@ -43,6 +43,12 @@ enum sample_format { SAMPLE_FORMAT_S24_P32, SAMPLE_FORMAT_S32, + + /** + * 32 bit floating point samples in the host's format. The + * range is -1.0f to +1.0f. + */ + SAMPLE_FORMAT_FLOAT, }; static const unsigned MAX_CHANNELS = 8; @@ -168,6 +174,7 @@ audio_valid_sample_format(enum sample_format format) case SAMPLE_FORMAT_S24: case SAMPLE_FORMAT_S24_P32: case SAMPLE_FORMAT_S32: + case SAMPLE_FORMAT_FLOAT: return true; case SAMPLE_FORMAT_UNDEFINED: @@ -241,6 +248,7 @@ sample_format_size(enum sample_format format) case SAMPLE_FORMAT_S24_P32: case SAMPLE_FORMAT_S32: + case SAMPLE_FORMAT_FLOAT: return 4; case SAMPLE_FORMAT_UNDEFINED: |