aboutsummaryrefslogtreecommitdiff
path: root/audio/alsaaudio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/alsaaudio.c')
-rw-r--r--audio/alsaaudio.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 4ef26818be..a23a5a0b60 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -307,6 +307,13 @@ static snd_pcm_format_t aud_to_alsafmt (AudioFormat fmt, int endianness)
return SND_PCM_FORMAT_U32_LE;
}
+ case AUDIO_FORMAT_F32:
+ if (endianness) {
+ return SND_PCM_FORMAT_FLOAT_BE;
+ } else {
+ return SND_PCM_FORMAT_FLOAT_LE;
+ }
+
default:
dolog ("Internal logic error: Bad audio format %d\n", fmt);
#ifdef DEBUG_AUDIO
@@ -370,6 +377,16 @@ static int alsa_to_audfmt (snd_pcm_format_t alsafmt, AudioFormat *fmt,
*fmt = AUDIO_FORMAT_U32;
break;
+ case SND_PCM_FORMAT_FLOAT_LE:
+ *endianness = 0;
+ *fmt = AUDIO_FORMAT_F32;
+ break;
+
+ case SND_PCM_FORMAT_FLOAT_BE:
+ *endianness = 1;
+ *fmt = AUDIO_FORMAT_F32;
+ break;
+
default:
dolog ("Unrecognized audio format %d\n", alsafmt);
return -1;