Giter Site home page Giter Site logo

Comments (9)

gen2brain avatar gen2brain commented on July 17, 2024

Can you try with C capture example https://github.com/dr-soft/miniaudio ? If it works there I can work on updating the library here.

from malgo.

cswank avatar cswank commented on July 17, 2024

Yes, I was able to run the c capture example, it seems to work fine.

from malgo.

egonelbre avatar egonelbre commented on July 17, 2024

Can you try whether v0.10.4 fixes things #19?

from malgo.

cswank avatar cswank commented on July 17, 2024

Unfortunately it looks like the same problem, but a different line number in miniaudi.sh:

➜ capture git:(fixes) ✗ go run .
Recording...
Press Enter to stop recording...
Assertion failed: (pLPF->format == ma_format_f32), function ma_lpf_process_pcm_frame_f32, file /Users/craig/Projects/malgo/miniaudio.h, line 31279.
signal: abort trap

from malgo.

egonelbre avatar egonelbre commented on July 17, 2024

Pushed an additional fix.

from malgo.

gen2brain avatar gen2brain commented on July 17, 2024

PR is merged, but I see now same error on the same line with playback example. When commenting that assert check on line 31279 it just works.

from malgo.

egonelbre avatar egonelbre commented on July 17, 2024

I suspect that the audio would be slowed down by some amount.

I think the reason is that the device uses sample rate that's defined in the file, rather what the device supports. It does seem to have resampling support and I think the playback example should use that instead.

Although there does seem to be some internal resampling available:

The `config.playback.channels` member sets the number of channels to use with the device. The channel count cannot exceed MA_MAX_CHANNELS. The
`config.sampleRate` member sets the sample rate (which must be the same for both playback and capture in full-duplex configurations). This is usually set to
44100 or 48000, but can be set to anything. It's recommended to keep this between 8000 and 384000, however.

Note that leaving the format, channel count and/or sample rate at their default values will result in the internal device's native configuration being used
which is useful if you want to avoid the overhead of miniaudio's automatic data conversion.

No clue why it would fail though.

from malgo.

cswank avatar cswank commented on July 17, 2024

Now master is working for me.

from malgo.

egonelbre avatar egonelbre commented on July 17, 2024

Managed to reproduce it directly in miniaudio. The difference is that currently the package is using empty DeviceConfig, however, the miniaudio examples use ma_device_config_init, which also sets deviceConfig.resampling.linear.lpfOrder.

from malgo.

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.