Skip to content
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

Displaying SampleBuf breaks if vector has NaN in it #45

Open
ssfrr opened this issue Oct 11, 2018 · 3 comments
Open

Displaying SampleBuf breaks if vector has NaN in it #45

ssfrr opened this issue Oct 11, 2018 · 3 comments

Comments

@ssfrr
Copy link
Collaborator

ssfrr commented Oct 11, 2018

MWE:

julia> SampleBuf([1.0, 1.0, NaN, 2.1], 44100)
4-frame, 1-channel SampleBuf{Float64, 1}
9.070294784580499e-5s sampled at 44100.0HzError showing value of type SampleBuf{Float64,1}:
ERROR: InexactError: trunc(Int64, NaN)
Stacktrace:
 [1] trunc at ./float.jl:693 [inlined]
 [2] _broadcast_getindex_evalf at ./broadcast.jl:574 [inlined]
 [3] _broadcast_getindex at ./broadcast.jl:557 [inlined]
 [4] _getindex at ./broadcast.jl:570 [inlined]
 [5] _broadcast_getindex at ./broadcast.jl:546 [inlined]
 [6] getindex at ./broadcast.jl:507 [inlined]
 [7] macro expansion at ./broadcast.jl:838 [inlined]
 [8] macro expansion at ./simdloop.jl:73 [inlined]
 [9] copyto! at ./broadcast.jl:837 [inlined]
 [10] copyto! at ./broadcast.jl:792 [inlined]
 [11] copy at ./broadcast.jl:768 [inlined]
 [12] materialize at ./broadcast.jl:748 [inlined]
 [13] showchannels(::IOContext{REPL.Terminals.TTYTerminal}, ::SampleBuf{Float64,1}, ::Int64) at /home/sfr/.julia/packages/SampledSignals/g9SOH/src/SampleBuf.jl:191
 [14] showchannels at /home/sfr/.julia/packages/SampledSignals/g9SOH/src/SampleBuf.jl:182 [inlined]
 [15] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::SampleBuf{Float64,1}) at /home/sfr/.julia/packages/SampledSignals/g9SOH/src/SampleBuf.jl:177
...
@haberdashPI
Copy link
Contributor

I ran into this error when testing my pull request branch. I added a very minimal fix for it.

@lazarusA
Copy link

@haberdashPI do you still have the minimal fix to this?

@haberdashPI
Copy link
Contributor

You can find it burried in here: #44

It's been a while since I've interacted with this repo, so I don't remember exactly where.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants