[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Noisy sound function output due to wrong nbits
From: |
Mike Miller |
Subject: |
Re: Noisy sound function output due to wrong nbits |
Date: |
Thu, 10 Aug 2017 08:50:09 -0700 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
On Thu, Aug 10, 2017 at 11:43:35 +0000, Bagus Tris Atmaja wrote:
> I have .wav files with 16 and 24 bits precision, when I read it with
> audioread and played it with sound function, I got noise sound. The syntax
> I used:
> >> [y, fs] = audioread('filename.wav');
> >> sound(y, fs)
>
> I got clean sound when I add nbits argument (n=16) to sound,
> >> sound(y, fs, 16);
>
> From the 'help sound', it is shown that default nbits is 8.
> So, in case we don't know now the nbits of wav file (I use sox to collect
> the information or old wavread althoug it gives warning), what's the
> workaround for the audioread function?
>
> I prefer to keep nbits output argument to the new audioread function.
Use the audioinfo function to get the number of bits per sample in the
original audio file:
info = audioinfo ("filename.wav");
disp (info.BitsPerSample)
--
mike
signature.asc
Description: PGP signature