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

NAudio support #491

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

NAudio support #491

wants to merge 1 commit into from

Conversation

Elecast2
Copy link

@Elecast2 Elecast2 commented Nov 1, 2023

Add NAudio with NVorbis support for better song waveform manipulation and improved delays.

TO DO:

  • Add song speed compatibility (Using a custom WaveProvider?)
  • Clean code, maybe use a separated file for anything NAudio related
  • Get volume from Master, currently it updates volume from song volume but doesn't multiply with master

Important changes are in AudioTimeSyncController.cs and SongTimelineController.cs, Everything else is from Plugins

Add NAudio with NVorbis support for better song waveform manipulation and improved delays.
@Elecast2 Elecast2 changed the title NAudio support for ChroMapper NAudio support Nov 1, 2023
SongAudioSource.Play();
//ELECAST TEST SongAudioSource.time = CurrentSeconds;
//ELECAST TEST SongAudioSource.Play();
SetVorbisPosition((long)(CurrentSeconds * bytesPerSecond));//ELECAST TEST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeking based on byte position instead of time might be inaccurate with variable bitrates
is there no way to seek based on time?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variable bitrates is not a problem since bytesPerSecond is obtained when we load the song file, or do you mean something else? I couldn't find a way to seek based on time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bitrate can vary throughout one file, not just between different files
by basing on the average bitrate, you can end up seeking to the wrong time

Copy link
Author

@Elecast2 Elecast2 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that makes sense, will check into that

@GalaxyMaster2
Copy link
Contributor

I'm concerned about how this will impact hitsound/metronome synchronization. It might be necessary to handle those through NAudio as well

@XAce1337manX XAce1337manX marked this pull request as draft November 5, 2023 14:20
@Elecast2
Copy link
Author

Elecast2 commented Nov 5, 2023

I'm concerned about how this will impact hitsound/metronome synchronization. It might be necessary to handle those through NAudio as well

Eventually the best would be to handle all through NAudio, it will require to write a mixer from scratch tho. Still I think it is more important to find a way to make song speed work before doing all of that.

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

Successfully merging this pull request may close these issues.

2 participants