Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Is it possible to use this with Audio Capture for live input? #13

Open
BorisKourt opened this issue Jul 6, 2023 · 6 comments
Open

Is it possible to use this with Audio Capture for live input? #13

BorisKourt opened this issue Jul 6, 2023 · 6 comments

Comments

@BorisKourt
Copy link

Not an issue, just wondering if this setup is supported?

Instead of:

Import sound wave -> Play sound wave -> Analyze audio data as the sound wave plays

Do:

Audio Capture -> Analyze audio data as the sound wave comes in
@gtreshchev
Copy link
Owner

Yes, it is possible. Instead of binding to OnGeneratePCMData, which is used during sound wave playback, you should bind to OnPopulateAudioData, which is broadcasted each time audio population occurs. This way, the audio data will be analyzed during the capturing process itself.

@BorisKourt
Copy link
Author

Thanks for the quick reply! I am having trouble adapting this part of the wiki based on your recommendation: https://github.com/gtreshchev/AudioAnalysisTools/wiki#example-of-detecting-a-beat-as-a-sound-wave-is-played

It appears that I still need an imported sound wave in order to make everything connect properly?

Is there any documentation on OnPopulateAudioData?

@BorisKourt
Copy link
Author

Screenshot 2023-07-07 at 02 24 06

Is this an appropriate direction? This is in a blueprint with just one Audio Capture in it.

@gtreshchev
Copy link
Owner

The documentation regarding the OnPopulateAudioData including is here: https://github.com/gtreshchev/RuntimeAudioImporter/wiki/Utilities

Yes, this looks proper. Since streaming and capturable sound waves are inherited from imported sound wave, they support the same functionality and leverage the same internal logic for accumulating and outputting the audio data. If you encounter too many beats occurring, you can take a look at the IsBeatRange function, for example.

@BorisKourt
Copy link
Author

BorisKourt commented Jul 10, 2023

Thanks for the replies.

Is there a way to specify the input device by name? Or does this always default to Unreal's system default detection?

I am able to read out the names of available input devices, and see their ids. But it appears that only one of the devices works at a time, none of the device IDs except for that one work. (This is on macos)

@gtreshchev
Copy link
Owner

I'm not entirely sure, but there might be platform-specific behavior that prevents using multiple input devices simultaneously. Although that's just my assumption, I haven't explored the workflow of capturing with multiple devices at the same time. As for identifying the input device, yes, I believe the only way is to take the ID integer into account when calling StartCapture and specifying the ID.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants