summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinod Koul <vkoul@kernel.org>2020-03-13 17:29:21 +0530
committerVinod Koul <vkoul@kernel.org>2020-03-13 17:29:21 +0530
commit2e530f06b3a745570ca1b4b64e59514fdccd77c1 (patch)
tree73f35f4a6504facc993afde1c7e9d3e97e54eea1
parentc8eeee9f5a205a1651e3ea0fbb9194f8c1dc5e15 (diff)
wma hackswma
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--src/utils-lgpl/fcplay.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/src/utils-lgpl/fcplay.c b/src/utils-lgpl/fcplay.c
index 58f6ebf..c7cf6ef 100644
--- a/src/utils-lgpl/fcplay.c
+++ b/src/utils-lgpl/fcplay.c
@@ -42,6 +42,8 @@ static const struct {
{ "IEC61937", SND_AUDIOCODEC_IEC61937 },
{ "G723_1", SND_AUDIOCODEC_G723_1 },
{ "G729", SND_AUDIOCODEC_G729 },
+ { "ALAC", SND_AUDIOCODEC_ALAC },
+ { "APE", SND_AUDIOCODEC_APE },
/* BESPOKE isn't defined on older kernels */
#ifdef SND_AUDIOCODEC_BESPOKE
{ "BESPOKE", SND_AUDIOCODEC_BESPOKE },
@@ -183,6 +185,10 @@ static int get_codec_id(int codec_id)
return SND_AUDIOCODEC_AMRWB;
case AV_CODEC_ID_PCM_S16LE ... AV_CODEC_ID_PCM_S16BE_PLANAR:
return SND_AUDIOCODEC_PCM;
+ case AV_CODEC_ID_ALAC:
+ return SND_AUDIOCODEC_ALAC;
+ case AV_CODEC_ID_APE:
+ return SND_AUDIOCODEC_APE;
default:
fprintf(stderr, "Not supported AVcodec: %d\n", codec_id);
exit(EXIT_FAILURE);
@@ -356,7 +362,51 @@ void play_samples(char *name, unsigned int card, unsigned int device,
memset(&codec, 0, sizeof(codec));
memset(&config, 0, sizeof(config));
- parse_file(name, &codec);
+#if 0
+ //parse_file(name, &codec);
+ codec.id = SND_AUDIOCODEC_ALAC;
+ codec.ch_in = 2;
+ codec.ch_out = 2;
+ codec.options.alac_d.frame_length = 4096;
+ codec.options.alac_d.compatible_version = 0;
+ codec.options.alac_d.pb = 40;
+ codec.options.alac_d.mb = 10;
+ codec.options.alac_d.kb = 14;
+ codec.sample_rate = 44100;
+ codec.options.alac_d.max_run = 255;
+ codec.options.alac_d.max_frame_bytes = 9530;
+ codec.bit_rate = 534580;
+ codec.id = SND_AUDIOCODEC_APE;
+ codec.ch_in = 2;
+ codec.ch_out = 2;
+ codec.sample_rate = 44100;
+ codec.options.ape_d.compatible_version = 3990;
+ codec.options.ape_d.compression_level = 2000;
+ codec.options.ape_d.format_flags = 0;
+ codec.options.ape_d.blocks_per_frame =73728;
+ codec.options.ape_d.final_frame_blocks = 62209;
+ codec.options.ape_d.total_frames = 75;
+ codec.options.ape_d.seek_table_present = 1;
+ codec.id = SND_AUDIOCODEC_WMA;
+ codec.ch_in = 2;
+ codec.ch_out = 2;
+ codec.profile = SND_AUDIOPROFILE_WMA9;
+ codec.bit_rate = 24078*8;
+ codec.align = 8192;
+ codec.sample_rate = 48000;
+ codec.options.wma_d.encoder_option = 15;
+#endif
+//#if 0
+ codec.id = SND_AUDIOCODEC_WMA;
+ codec.ch_in = 2;
+ codec.ch_out = 2;
+ codec.profile = SND_AUDIOPROFILE_WMA9_PRO;
+ codec.bit_rate = 48000*8;
+ codec.align = 16834;
+ codec.sample_rate = 48000;
+ codec.options.wma_d.encoder_option = 224;
+//#endif
+
config.codec = &codec;