Git Product home page Git Product logo

Comments (5)

bjarthur avatar bjarthur commented on September 15, 2024

i should add that were this a write problem, then it might be related to issue #7. also, here's my version info:

julia> versioninfo()
Julia Version 0.3.0-prerelease+1578
Commit 052869f* (2014-02-14 13:00 UTC)
Platform Info:
System: Linux (x86_64-redhat-linux)
CPU: Intel(R) Xeon(R) CPU E5645 @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm

julia> Pkg.status()
6 required packages:

  • ClusterManagers 0.0.1
  • Debug 0.0.0
  • Devectorize 0.2.1
  • Distributions 0.3.4
  • MAT 0.2.2
  • WAV 0.2.2

7 additional packages:

  • ArrayViews 0.4.0
  • BinDeps 0.2.12
  • HDF5 0.2.17
  • NumericExtensions 0.4.3
  • StatsBase 0.3.6
  • URIParser 0.0.1
  • Zlib 0.1.3

from wav.jl.

dancasimiro avatar dancasimiro commented on September 15, 2024

The wavwrite function uses the PCM format by default. You need to specify IEEE float (compression=WAVE_FORMAT_IEEE_FLOAT) when you write the file:

wavwrite(tmp,"foo.wav"; nbits=32, compression=WAVE_FORMAT_IEEE_FLOAT)

from wav.jl.

bjarthur avatar bjarthur commented on September 15, 2024

ahah, that works. the documentation though says that if the data are floats and nbits is 32 then the output format is single, and makes no mention of the compression format there. perhaps the table needs to be updated?

also, i've uncovered another related error:

julia> tmp=rand(Float32,(10,2))
10x2 Array{Float32,2}:
0.402853 0.359412
0.839331 0.918946
0.37568 0.355417
0.631095 0.914516
0.529367 0.796124
0.771321 0.21159
0.464903 0.874699
0.396011 0.121397
0.149417 0.0536192
0.470153 0.17993

julia> wavwrite(tmp,"foo.wav"; compression=WAVE_FORMAT_IEEE_FLOAT)
ERROR: 16 bits is not supported for WAVE_FORMAT_IEEE_FLOAT.
in error at error.jl:21
in ieee_float_container_type at /Users/arthurb/.julia/WAV/src/WAV.jl:201
in write_ieee_float_samples at /Users/arthurb/.julia/WAV/src/WAV.jl:322
in write_data at /Users/arthurb/.julia/WAV/src/WAV.jl:348
in wavwrite at /Users/arthurb/.julia/WAV/src/WAV.jl:436
in wavwrite at /Users/arthurb/.julia/WAV/src/WAV.jl:442

from wav.jl.

dancasimiro avatar dancasimiro commented on September 15, 2024

I will look into changing the default nbits value when the compression is set to WAVE_FORMAT_IEEE_FLOAT.

I will also push a change into the documentation, unless you submit a pull request first. You can edit README.md through the github web interface and create a pull request.

from wav.jl.

dancasimiro avatar dancasimiro commented on September 15, 2024

I finally got around to working on this. Let me know if I missed anything.

from wav.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.