Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Stable versions
4.3.0 (?):
Changes by Alice Rowan
- Support 24-bit and 32-bit output (requires libxmp 4.7.0+):
ALSA, BeOS/Haiku, CoreAudio, NetBSD, OSS, PulseAudio,
AHI, ALSA, BeOS/Haiku, CoreAudio, NetBSD, OSS, PulseAudio,
sndio, WinMM, AIFF, file, WAV.
- Use XMP_MAX_SRATE as the limit for -f instead of 48000
(requires libxmp 4.7.0+).
Expand Down
31 changes: 25 additions & 6 deletions src/sound_ahi.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ static void close_libs(void)
static int init(struct options *options)
{
unsigned long fmt;
int channels;
int bits;

AHImp = CreateMsgPort();
if (AHImp == NULL) {
Expand All @@ -97,10 +99,26 @@ static int init(struct options *options)
goto err;
}

if (options->format & XMP_FORMAT_8BIT) {
fmt = options->format & XMP_FORMAT_MONO ? AHIST_M8S : AHIST_S8S;
} else {
fmt = options->format & XMP_FORMAT_MONO ? AHIST_M16S : AHIST_S16S;
bits = get_bits_from_format(options);
channels = get_channels_from_format(options);

switch (bits) {
case 8:
fmt = (channels == 1) ? AHIST_M8S : AHIST_S8S;
bits = 8;
break;
case 16:
default:
fmt = (channels == 1) ? AHIST_M16S : AHIST_S16S;
bits = 16;
break;
#if defined(AHIST_M32S) && defined(AHIST_S32S)
case 24:
case 32:
fmt = (channels == 1) ? AHIST_M32S : AHIST_S32S;
bits = 32;
break;
#endif
}

AHIReq[0]->ahir_Std.io_Command = CMD_WRITE;
Expand All @@ -119,8 +137,9 @@ static int init(struct options *options)
goto err;
}

options->format &= ~XMP_FORMAT_UNSIGNED;
options->format &= ~XMP_FORMAT_32BIT;
update_format_bits(options, bits);
update_format_signed(options, 1);

active = 0;
return 0;

Expand Down
Loading