arianrhodsandlot / nostalgist

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

audiocontext #33

Closed zhangmenglong-github closed 3 months ago

zhangmenglong-github commented 4 months 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 4 months 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)