How to implement virtual surround sound

I want to achieve a virtual surround sound, how should I do, what is the implementation principle, there is a source reference.

There seem to be many different implementations. They generally use frequency dependent delays. Mostly is is marketing hype.
There’s some info on Wikipedia: https://en.wikipedia.org/wiki/Virtual_surround

Yeah… There are some “tricks” but there’s no reliable way to make it seem like the sound is coming from behind when it’s not.

You can search for a virtual surround plug-in or a stereo widening plug-in. Most of these can have weird side-effects and some will mess-up mono playback so keep that in-mind if you ever want to play the file on a phone-speaker or some other mono system.

Then, it depends on if you’re starting-out with a stereo or 5.1/7.1 source and if you are listening on headphones/speakers.

With a stereo source and stereo speakers (not headphones) you can try something simple to start with - [u]Split the stereo track[/u]. (That simply allows you to edit the left & right channels separately.) Then select one track and [u]Invert[/u] one channel. That creates a “spacey” effect when certain frequencies cancel in the air, depending on head position and room reflections. Unfortunately with music the bass gets canceled.

For surround-sound tracks (i.e. mostly games & movies) and headphones there is [u]Dolby Headphone[/u] and some other-similar effects. Some people get the full-surround effect, but the illusion doesn’t work for me… I don’t hear sounds coming from behind. (Dolby doesn’t actually claim that you’ll hear sounds coming from behind.)

Oh, there is one thing that probably works with surround tracks and headphones… Head-tracking headphones that adjust the sound depending on the position of your head… I’ve never had a chance to try them. Normally (without headphones) you locate sounds by moving your head to get “multiple readings” to triangulate the source of the sound as your ears pick-up loudness & timing differences between the left & right ears. The movement may be slight and subconscious as you sometimes look around to see where the sound is coming from.

Thanks for Steve’s reply, may I ask if there is any code to implement virtual surround sound in audacity’s source code

Thanks for DVDdoug’s reply. May I ask if there is any code to implement virtual surround sound in Audacity’s source code

No there isn’t. There’s just an option to export files with multiple channels (https://manual.audacityteam.org/man/advanced_mixing_options.html), but you need to handle what audio is in each channel.

Thank you very much!!!