Cropping audio with XNA?

If you can wait for XNA 4, there is low level access to sound buffers, and you can crop it however you want. A google search of "C# wav file" reveals plenty of links that will show you how to manipulate the data in memory.

If you can wait for XNA 4, there is low level access to sound buffers, and you can crop it however you want. A google search of "C# wav file" reveals plenty of links that will show you how to manipulate the data in memory. Download XNA 4.0 beta here: creators.xna.com/en-US/launchcenter Here is a link that explains how to use the new API: https://blogs.msdn.Com/b/ashtat/archive/2010/06/03/soundeffect-creation-in-xna-game-studio-4.aspx.

I don't see a way to do what you're saying but in the process of looking, I did come across this helpful Audio Overview and this tutorial on using Microsoft's Cross-platform Audio Creation Tool (XACT). Since you are new to XNA, I hope those links provide some help. The problem seems to be that the expectation is that audio is created before-hand instead of in-game, as you require.

Of course, there is no shortage of external audio editors such as Audacity, Aviary, waveosaur and Adobe SoundBooth to help with editing outside of the game. Alternatively, you may be able to use the playback features of the XNA / XACT libraries to "simulate" croping by storing the user's time frame selections as variables and only playing back the correspoding portions of the audio, later. I hope some of that helps in some capacity.

-gMale.

Thanks for the response. The audio loaded will be from the user themselves, so I won't be able to edit it outside the app. What methods do I use to save the 'cropped' audio out into a new file?

– Skoder Jul 8 '10 at 1:24.

As far as I know, XNA does not contain any means to simply write a music or cue object to a file. If you want the user to edit the audio within your XNA game and save it as a still-usable audio file, you'll have to discover the correct file format and write it directly. However, if you just want them to manipulate the audio for use within your game, I believe you have another option.

You can serialize objects (in order to save your state between games). You can store values representing your manipulations of the audio (eg, start and end times), and serialize them along with the cue. I must admit that I've never tried serializing an audio cue, but you could try pushing your data into the XNA content pipeline, forcing it to create a XNB file for you at runtime.

Thanks. What methods and classes should I be looking at to set information such as the current selected time? As far as I can tell, I can only get the PlayPosition.

Are there any other . NET classes that might help me write out to a WMA file (e.g. Silverlight)? – Skoder Jul 8 '10 at 17:01.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions