Dear sir, I've a problem that the .wav file couldn't play after calling "sampleenc male.wav|sampledec male_speex_15.wav".I found that the new file male_speex_15.wav is smaller than the original file in size.I implemented the test on Linux system.The original file male.wav is 96044 bytes,while the new file male_speex_15.wav is 96000 bytes.I'm eager to know the reason.Thankyou! sincerely, Weiqin Bao -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20070712/a54e8550/attachment.htm
Jean-Marc Valin
2007-Jul-12 05:52 UTC
[Speex-dev] file couldn't play after Speex encode and decode
How about: sampleenc male.wav - |sampledec - male_speex_15.wav instead? Jean-Marc ? a ?crit :> Dear sir, > I've a problem that the .wav file couldn't play after calling "sampleenc > male.wav|sampledec male_speex_15.wav".I found that the new file > male_speex_15.wav is smaller than the original file in size.I implemented > the test on Linux system.The original file male.wav is 96044 bytes,while > the > new file male_speex_15.wav is 96000 bytes.I'm eager to know the > reason.Thankyou! > > sincerely, > Weiqin Bao > > > ------------------------------------------------------------------------ > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev
John Edwards
2007-Jul-12 06:04 UTC
[Speex-dev] file couldn't play after Speex encode and decode
This is because the output file has been written without the 44 byte wave file header. John ? wrote:> Dear sir, > I've a problem that the .wav file couldn't play after calling "sampleenc > male.wav|sampledec male_speex_15.wav".I found that the new file > male_speex_15.wav is smaller than the original file in size.I > implemented the test on Linux system.The original file male.wav is 96044 > bytes,while the new file male_speex_15.wav is 96000 bytes.I'm eager to > know the reason.Thank you! > > sincerely, > Weiqin Bao > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: 11/07/2007 21:57
John Edwards
2007-Jul-13 04:12 UTC
[Speex-dev] file couldn't play after Speex encode and decode
I suggest that you write the command line as Jean-Marc suggested: speexenc sample.wav - | speexdec - sample_out.wav I have tested this and it works as expected. You need to specify the '-' for stdin and also for stdout. John As an aside, I notice that the wave output from speexdec does not write the wave file header when the output is destined for stdout. I believe this is incorrect and that the first write of the header should be performed so that the output can be identified. Clearly the subsequent seeks to rewrite the header information should only be performed on a 'real' output file. ? wrote:> > thank you,sir!But I don't konw how to add the file header.Could you help me? > 2007/7/12, John Edwards <john.edwards33@ntlworld.com > <mailto:john.edwards33@ntlworld.com> >: > > This is because the output file has been written without the 44 byte > wave file header. > > John > > ? wrote: > > Dear sir, > > I've a problem that the .wav file couldn't play after calling > "sampleenc > > male.wav|sampledec male_speex_15.wav".I found that the new file > > male_speex_15.wav is smaller than the original file in size.I > > implemented the test on Linux system.The original file male.wav > is 96044 > > bytes,while the new file male_speex_15.wav is 96000 bytes.I'm > eager to > > know the reason.Thank you! > > > > sincerely, > > Weiqin Bao > > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Speex-dev mailing list > > Speex-dev@xiph.org <mailto:Speex-dev@xiph.org> > > http://lists.xiph.org/mailman/listinfo/speex-dev > > > > > > > ------------------------------------------------------------------------ > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.5.476 / Virus Database: 269.10.4/897 - Release Date: > 11/07/2007 21:57 > > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 12/07/2007 16:08
John Edwards
2007-Jul-14 01:45 UTC
[Speex-dev] file couldn't play after Speex encode and decode
The encoded speex file should, by convention, be given the '.spx' extension rather than '.wav', but that is not the issue. What appears to be happening is that the '.wav' extension on your named output file from speexdec is not being recognised as '.wav' and, consequently, the file is being written as 'raw' data without the wave file header. I am not sure why that should be other than to suggest that maybe your system generates unicode/wide chars that speexdec is failing to recognise? Best I can do, I'm afraid. John ? wrote:> I did as follows:in speexenc.c, I created a outfile;in speexdec.c,I set > the outfile as infile.So,i implemented like this: > speexenc sample.wav tmp.wav > then, > speexdec tmp.wav sampleout.wav > But,the sampleout.wav still lacked the file header.I think I didn't > got your words right.Could you explain more detailed how i should > do?Thanks a lot! > sorry to bother you so much. > > 2007/7/13, John Edwards <john.edwards33@ntlworld.com > <mailto:john.edwards33@ntlworld.com>>: > > I suggest that you write the command line as Jean-Marc suggested: > > speexenc sample.wav - | speexdec - sample_out.wav > > I have tested this and it works as expected. You need to specify the '-' > for stdin and also for stdout. > > John > > As an aside, I notice that the wave output from speexdec does not write > the wave file header when the output is destined for stdout. I believe > this is incorrect and that the first write of the header should be > performed so that the output can be identified. Clearly the subsequent > seeks to rewrite the header information should only be performed on a > 'real' output file. > > ? wrote: > > > > thank you,sir!But I don't konw how to add the file header.Could > you help me? > > 2007/7/12, John Edwards <john.edwards33@ntlworld.com > <mailto:john.edwards33@ntlworld.com> > > <mailto:john.edwards33@ntlworld.com > <mailto:john.edwards33@ntlworld.com>> >: > > > > This is because the output file has been written without the > 44 byte > > wave file header. > > > > John > > > > ? wrote: > > > Dear sir, > > > I've a problem that the .wav file couldn't play after calling > > "sampleenc > > > male.wav|sampledec male_speex_15.wav".I found that the new > file > > > male_speex_15.wav is smaller than the original file in size.I > > > implemented the test on Linux system.The original file > male.wav > > is 96044 > > > bytes,while the new file male_speex_15.wav is 96000 bytes.I'm > > eager to > > > know the reason.Thank you! > > > > > > sincerely, > > > Weiqin Bao > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > _______________________________________________ > > > Speex-dev mailing list > > > Speex-dev@xiph.org <mailto:Speex-dev@xiph.org> <mailto: > Speex-dev@xiph.org <mailto:Speex-dev@xiph.org>> > > > http://lists.xiph.org/mailman/listinfo/speex-dev > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > No virus found in this incoming message. > > > Checked by AVG Free Edition. > > > Version: 7.5.476 / Virus Database: 269.10.4/897 - Release > Date: > > 11/07/2007 21:57 > > > > > > > > > ------------------------------------------------------------------------ > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: > 12/07/2007 16:08 > > > > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.476 / Virus Database: 269.10.4/898 - Release Date: 12/07/2007 16:08