-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example here - https://github.com/jstrait/wavefile/wiki/WaveFile-Tutorial#copying-a-wave-file-to-different-format working correctly? #15
Comments
@jstrait I've also tried same sample but a bit different way. Seems like playback is just accelerated proportionally. Writer.new("output.wav", Format.new(:stereo, :pcm_16, 44100)) do |writer|
Reader.new("input.wav").each_buffer(4096) do |buffer|
writer.write(buffer.convert!(Format.new(:stereo, :pcm_16, 44100)))
end
end
info('input.wav')
info('output.wav') Output:
Btw, conversion worked for me via SoX library
Thank you in advance for any help. |
Hey @dbreaker, do you know what the sample rate of
If the sample rate of |
@movstox the gem just writes whatever sample rate you give it into the resulting wave file. For example, if you have incoming sample data that had an original sample rate of 44,100Hz, and you write it out to a file using From your example Sox appears to be re-sampling the file to use the new sample rate (i.e. 44,100Hz instead of 8,000Hz) so that it has the same pitch. I say that because in the original, there are 1,134,880 sample frames, while in the output there are 6,256,026 sample frames. This would be consistent would adding additional samples so that the file sounds the same, even though the sample rate is higher. |
Since I believe that I answered the questions, and there haven't been any follow up comments in several months, closing this out. |
Thanks for your help. On 31.10.2015 at 19:19 GMT None wrote:
|
@jstrait sorry if this is a total newbie issue, but when I run the example here - https://github.com/jstrait/wavefile/wiki/WaveFile-Tutorial#copying-a-wave-file-to-different-format with a voice recording, the resulting audio file sound like chipmunks. Here's my code example. Any clue on what I am doing wrong? Great gem, love working with it so far.
The text was updated successfully, but these errors were encountered: