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

Generating the waveform using multiple dat files #542

Closed
vivekd95 opened this issue Aug 27, 2024 · 7 comments
Closed

Generating the waveform using multiple dat files #542

vivekd95 opened this issue Aug 27, 2024 · 7 comments

Comments

@vivekd95
Copy link

Hi
Right now, I am generating the waveform from a single .dat file. Now, I want to generate the same waveform from multiple .dat files extracted from the same media file. Now, I want each dialogue in that media to have its separate .dat file, which I ultimately want to use to render the dialogues as segments on the waveform. Is there any way to do that?

@chrisn
Copy link
Member

chrisn commented Aug 27, 2024

I'm not sure I understand fully. How do the .dat files relate to the media file? Are they from different audio tracks or channels within the media, so run concurrently, or from different time periods?

@vivekd95
Copy link
Author

I am sorry for this confusion.
Let me try to clear it up.

After extracting the mp3 from the mp4(the said media) I am using audiowaveform to create a binary waveform data file (.dat). Then, I used this created .dat file and sent it to arraybuffer to generate the waveform data.

@chrisn
Copy link
Member

chrisn commented Aug 27, 2024

Thanks, that's ok. Does the setSource() method work in this case? This lets you change the audio and waveform URLs.

There's an example here: https://github.com/bbc/peaks.js/blob/master/demo/set-source.html

@vivekd95
Copy link
Author

Yeah but for this I need a single waveform URL, right?
Let me explain my exact use case. I am trying to make a dubbing tool. Now for each dubbed dialogue, I need to add an individual segment that I want to get appended on the waveform one by one based on user action. Now for each dialogue, I have separate mp3 and binary waveform data files aka .dat file. Now, Suppose in the beginning I have only one dialogue which means I only have one .dat file. Now, If I want to add another dialogue which means I will have another .dat file that will create the waveform for that particular portion. I want to append this new waveform data part to the existing one. Do we have anything in peaks,js for this kind of functionality, or do I have to do it manually in any other way if possible?

@chrisn
Copy link
Member

chrisn commented Aug 28, 2024

Yes, setSource() only lets you provide a single waveform, to go with a single audio file. So you'd have to do this manually. setSource allows you to provide your own WaveformData object, which could be constructed from others using the concat and slice methods, possibly. https://github.com/bbc/waveform-data.js/blob/master/doc/API.md

@vivekd95
Copy link
Author

vivekd95 commented Aug 29, 2024

I know it is a strange question but Is it possible to generate the waveform view without the waves/peaks?

image
I meant that, as you can see in the screenshot above, you will see the line across the waveform. I want only that line without any peaks or waves. If yes, then how?

@chrisn
Copy link
Member

chrisn commented Aug 29, 2024

I don't think so, currently. Maybe a solution could be to allow fully custom waveform rendering, then you could implement any rendering you like, including drawing nothing.

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

2 participants