Decrease audio compression rate - c#

Hi I Want to Decrease the Compression rate/Playing Speed of My Audio Tracks in C# Using NAudio class, i.e. I want tracks to play at a slower speed than their original speed.
Previously I was using Windows Media Player object for just this thing and NAudio for everything else, but I want to shift completely to NAudio.

NAudio does not have a built-in feature to do this. When I need to change playback rate, I create a managed wrapper around the SoundTouch dll. I keep meaning to blog about how to do this, but for now, check out the PracticeSharp project which also uses SoundTouch and NAudio.

Related

Controlled pitch or frequency shifting in Unity3d

TL;DR - I'm looking for a plugin or technique to pitch shift audio assets precisely.
I'm working on a unity3d project to create a binaural VR music visualizer (why I'm trying). I've created a basic visualizer and the music player components pretty easily with tutorials online but I'd like to find an easy way of frequency shifting audio tracks. This is similar to pitch-shifting, which unity supports via the Audio Pitch Shifter Effect but it's expressed as a multiplier rather then a unit of measure and effects playback speed. However, I need to pitch-shift the audio while maintaining playback rate as the normal audio plays in one ear, and the effected audio plays in the other.
The goal being that I can use a standard slider to decide the frequency of the binaural wave, and relate it to the left and right audio output, and with the VR solution, I can provide similar bi-visual effects at the appropriate frequency in each eye for a more intense effect.
I think I might have found my own solution buried in plugins - but it's much more specific then I would have thought: https://www.assetstore.unity3d.com/en/#!/content/66518
Though I would like to hear anyone else's approach to advanced audio effects like this.

Play sound with reverb effect with NAudio library?

I am using in my C# winForms application great audio library - NAudio. I am playing sounds by the use of WAVE cache and PlayEngine and i have a question:
Is it possible (and if YES: how?) to play sound with reverb effect with NAudio?
NAudio does not include a reverb effect. It does provide access to the raw audio samples, so you can implement your own effect algorithms. Another option might be to see if there is a Reverb MFT installed and pass the audio through (in the same way that the NAudio MFResampler works).
So the short answer is, unfortunately it's not easy to do.

Using Core Audio API to change volume of rear channels

I'm trying to create a background application that allows me to easily change volumes of the rear channels
I've looked into the Core Audio API, and although I managed to change the balance/volume of the front speakers, the API seemingly had no access to the rear channels or any other surround channel. It only counted 2 channels for my audio device.
Is it in any way possible, using any API, to control the rear channel's volume?
Thanks in advance!
EDIT
Thanks, FMOD looks like what I need, although it's a bit overwhelming. :P What would I need to do, to change the volume of a specified channel. I believe I need this function:
FMOD.RESULT result = channel.setVolume(1.0f);
But then I need to find a way to specify the channel...
Also, to be clear: I need to change the volume of any running application, say Winamp.
Best chose for working with audio file is "Fmod.dll".this have a lot of Privilege to work with audio file.
This is an audio content creation tool for games, with a focus on a
‘Pro Audio’ approach. It has an entirely new interface that will be
more familiar to those using professional Digital Audio Workstations
than existing game audio tools and is loaded with new features.
I already use this,this is very powerful component and easy to use.

Need to record all sounds from sound card with NAudio in Windows 7

Need to record all sounds from sound card. So that mic+output was written to file.
Is it possible to do with NAudio library in Windows 7? Cant find any examples, found just ones that allow to write mic or just sound from speakers, not both.
PS, sorry, if the question looks not ok..Im new to audiorecording.
Added issue ive asked on codeplex: http://naudio.codeplex.com/workitem/16353
To record sounds being played by the soundcard, you would use WASAPI in Loopback Mode.
To record sounds going into the microphone you could use WASAPI capture, or any of the other microphone capture classes in NAudio.
Then you have the slightly tricky job of mixing those two inputs together. This may require sample rate conversion beforehand, and it may require you to timestamp the recorded audio (as the loopback audio can contain gaps when nothing is being played).
With NAudio, you would convert both streams to floating point, before mixing them using one of the "Mixer" wave or sample providers in NAudio, and then writing that back out to a file.
So yes it is possible, and I have done it once before myself, but it does require you to write a fair bit of your own code on top of the core NAudio libraries.

How to play dynamic sounds in XNA?

Is it possible to dynanmically generate sounds with XNA C# code?
I looked into this some time ago when XNA was first released. At that time it was only possible to playback sound resources included in the compiled code.
Have there been any changes or new features added since XNA 1.0 that would allow an XNA application to generate and playback audio on the fly?
Yes.
XNA 4.0 added support for dynamic audio that allows you to:
Create a regular immutable sound
effect from a raw buffer using the SoundEffect.FromStream method.
Create a
DynamicSoundEffectInstance object then modify the audio data of this new
streaming sound effect object
dynamically.
Read more in the blog entry What’s “Dynamic” about this SoundEffectInstance? and in the AppHub article Dynamic Audio.
I think you can do this in XNA with DirectSound. Here's a link with code that seems to do what you want:
http://forums.create.msdn.com/forums/t/40361.aspx
Depends how dynamic you want to get. I know that XACT will let you change pitch and such, which, when combined with using cues in a programmatic fashion, can give some nice results.
If you want to generate your own waveform, you're out of luck. There's always the option of dropping below the framework and doing it yourself.

Categories

Resources