Skip to content
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

Waveform drawing #48

Open
hutterm opened this issue Oct 10, 2018 · 6 comments
Open

Waveform drawing #48

hutterm opened this issue Oct 10, 2018 · 6 comments

Comments

@hutterm
Copy link

hutterm commented Oct 10, 2018

is it possible to use this library to draw the waveform of a whole audio file in various detail, or is this just for live-drawing of the spectrum of a running audio?

@tonuv
Copy link
Collaborator

tonuv commented Oct 10, 2018

Currently this is meant for live drawing, but it would be a good feature suggestion. There are two ways of doing it. Build an AudioGraph with file input node and frame output node - after start you will get all the frames uncompressed in the output node. Second way would be to use IMFSourceReader which can sequencially scan and uncompress the samples.
Are you looking for a raw PCM sample data from the file? In what way are you looking to display it - sample values, RMS, spectrum?

@hutterm
Copy link
Author

hutterm commented Oct 17, 2018

k, looked into it, got stuck at how to get an audiograph from a video file's audio... any hints on that?

@eigoninaritai-naokichi
Copy link

eigoninaritai-naokichi commented Oct 18, 2018

I would like to know more information about using AudioGraph to draw the waveform of a whole audio file. I’m looking for how to draw now.
And if I use AudioGraph, can I draw it from video file like mp4?

@tonuv
Copy link
Collaborator

tonuv commented Nov 8, 2018

First now that we have a major rewrite update out of this package I will look at this feature request.

But you can use AudioGraph in this way (and yes it works for audio files as long as the appropriate codecs are available) - the only caveat is that you need to have audio hw available on that pc otherwise you cannot create the graph. Call AudioGraph.CreateAsync to create the graph, then on the graph instance call CreateFileInputNodeAsync and CreateFrameOutputNode. Call AddOutgoingConnection on the file node to connect it to output node. Now when you call Start on the audiograph you can call GetFrame for outputnode inside the graphs QuantumProcessed event to get the decoded data.

@tonuv
Copy link
Collaborator

tonuv commented Feb 1, 2019

Ability to read frames out of the file is now in the latest release. Drawing will be coming in the one of the next updates

@Panda-Sharp
Copy link

Hi @hutterm and @eigoninaritai-naokichi if you're still interested in a waveform, meanwhile I managed to draw it using NAudio, if you're interested feel free to contact me

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

No branches or pull requests

4 participants