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

trying to use pitch detect but failing #16

Open
pm100 opened this issue Apr 9, 2022 · 0 comments
Open

trying to use pitch detect but failing #16

pm100 opened this issue Apr 9, 2022 · 0 comments

Comments

@pm100
Copy link

pm100 commented Apr 9, 2022

in index.html

<script src="https://unpkg.com/aubiojs"></script>

I have this in ts (ignore the name, this is not a worklet, it starts one , now that scriptnode is deprecated), using your .d.ts file

class PitchDetectWorklet {
    audioContext!: AudioContext;
    running: boolean = false;
    pitchWorklet!: AudioWorkletNode;
    cb: (note: number, freq: number) => void;
    options: PitchDetectOptions;
    stream!: MediaStream;
    aupitch!: Pitch;  <<<<==
    au!: Aubio; <<<< ====

and then

        this.au = await aubio();
        this.aupitch = new this.au.Pitch('default', 128 * (this.options.buffersize || 10), 1, this.audioContext.sampleRate );

this all works fine.

But then when I get a buffer from my worklet I do

                var buff = ev.data.buff;
                var freq = that.aupitch.do(buff);

I always get

   Uncaught RuntimeError: null function or function signature mismatch
at 00068a0a:0x15c89
at 00068a0a:0xe02b
at Pitch$do [as do] (eval at Gb (aubiojs:38:242), <anonymous>:9:10)
at MessagePort.pitchWorklet.port.onmessage (worklet_caller.js:34:51)

I think I have copied everything from your tuner demo. I have run out of ideas

fails edge and chrome

chrome gives better debug stack

    local.get $var1
    i32.load offset=8
    local.get $var1
    i32.load offset=4
    local.get $var1
    i32.load offset=12
    i32.load offset=40
    call_indirect (param i32 i32 i32) <<<<<===== 15c89
    local.get $var1
    i32.load offset=8
    local.get $var1
    i32.load offset=12
    f32.load offset=52
    call $func92
    i32.const 1
    i32.eq
    if
      local.get $var1
      i32.load offset=4
      i32.load offset=4
      f32.const 0.0
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

1 participant