Commit 4be6db6a6163e3a0ccd85e7e193f54406c80a29a
Float only
cel committed on 10/24/2016, 6:06:56 PMParent: e03a630124fa47eb03d508fcfd576f8ebe4f28f1
Files changed
studio.c | changed |
studio.c | |||
---|---|---|---|
@@ -95,13 +95,8 @@ | |||
95 | 95 … | int bps = format_bits / 8; /* bytes per sample */ | |
96 | 96 … | int phys_bps = snd_pcm_format_physical_width(format) / 8; | |
97 | 97 … | int big_endian = snd_pcm_format_big_endian(format) == 1; | |
98 | 98 … | int to_unsigned = snd_pcm_format_unsigned(format) == 1; | |
99 | - int is_float = ( | ||
100 | - format == SND_PCM_FORMAT_FLOAT_LE || | ||
101 | - format == SND_PCM_FORMAT_FLOAT_BE || | ||
102 | - format == SND_PCM_FORMAT_FLOAT64_LE || | ||
103 | - format == SND_PCM_FORMAT_FLOAT64_BE); | ||
104 | 99 … | ||
105 | 100 … | /* verify and prepare the contents of areas */ | |
106 | 101 … | for (chn = 0; chn < channels; chn++) { | |
107 | 102 … | if ((areas[chn].first % 8) != 0) { | |
@@ -123,18 +118,14 @@ | |||
123 | 118 … | float f; | |
124 | 119 … | int i; | |
125 | 120 … | } fval; | |
126 | 121 … | int res, i; | |
127 | - if (is_float) { | ||
128 | - if (dl->handle && dl->tune->play) { | ||
129 | - fval.f = dl->tune->play(dl->tune, phase); | ||
130 | - } else { | ||
131 | - // val.f = sin(phase); | ||
132 | - fval.f = 0; | ||
133 | - } | ||
134 | - res = fval.i; | ||
135 | - } else | ||
136 | - res = sin(phase) * maxval; | ||
122 … | + if (dl->handle && dl->tune->play) { | ||
123 … | + fval.f = dl->tune->play(dl->tune, phase); | ||
124 … | + } else { | ||
125 … | + fval.f = 0; | ||
126 … | + } | ||
127 … | + res = fval.i; | ||
137 | 128 … | if (to_unsigned) | |
138 | 129 … | res ^= 1U << (format_bits - 1); | |
139 | 130 … | for (chn = 0; chn < channels; chn++) { | |
140 | 131 … | /* Generate data in native endian format */ |
Built with git-ssb-web