arianrhodsandlot / nostalgist

A JavaScript library used for running emulators of retro consoles inside browsers.
https://nostalgist.js.org
MIT License
643 stars 17 forks source link

audiocontext #33

Closed zhangmenglong-github closed 4 weeks ago

zhangmenglong-github commented 1 month ago

Hello, I want to change some games to an online version. When synchronizing audio streams, I cannot obtain the audio stream. How can I read the audio stream data in the game?

arianrhodsandlot commented 1 month ago

A new API getEmscriptenAL has been added since v0.10.0. We can access some audio related properties from its return value. Could this fit your need?

const AL = nostalgist.getEmscriptenAL()
console.log(AL.currentCtx, AL.currentCtx.audioCtx)