-
Notifications
You must be signed in to change notification settings - Fork 238
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
Load an arbitrary file with AudioIn in a simulator. #1390
Comments
I think this issue is a feature request to provide a way to override the default WAVE file used by audio input simulator. Today the only way to do that is to modify the path in You tried overriding that path by modifying the path in the replay example. That didn't give the expected result because of the way One easy approach would be to provide an option to the constructor to pass the name of the resource. There are currently no arguments to the constructor, so this will not cause any compatibility issues: constructor(options) {
this.#wav = new Resource(options?.resource ?? "sim.wav"); The disadvantage of this approach is that now the calling code includes knowledge of the simulator which is misleading when running on the device: new AudioIn{{resource: "wilhelm-scream.wav"}); An alternative is to use a constructor(options) {
this.#wav = new Resource(config.audioInWave ?? "sim.wav"); What approach do you think makes the most sense? |
Sorry for the confusion with the question, but this is a feature request.
Yes, I agree. It would be better if there were source code compatibility between the simulator and the device. Therefore, using a |
No problem. I agree that the FYI – I noticed that the replay example didn't play the default sound correctly. That is because the source data is stern, which the audioIn module and the replay example didn't handle correctly. I've got fixes for that as well (not so important as stereo audio input on embedded is relatively rare, but... the example should work correctly. |
Fixed. |
Build environment: macOS
Moddable SDK version: c40c945
Target device: desktop simulator
Steps to Reproduce
$MODDABLE/examples/pins/audioin/replay
and add resource that I want to load tomanifest.json
.2 Build and install the app using this build command:
mcconfig -d -m
3. Play
bflatmajor
Other information
I confirmed
data
section of$MODDABLE/build/tmp/mac/mc/debug/replay/manifest_flat.json
.Key
sim
has multiple value and$MODDABLE/build/tmp/mac/mc/debug/replay/resources/sim.wav
isbflatmajor
.I’m not sure if the manifest is being loaded correctly, but being able to load arbitrary files would make it more convenient to develop features using AudioIn.
The text was updated successfully, but these errors were encountered: