Real-time space directional stereo decoding method

文档序号:196487 发布日期:2021-11-02 浏览:46次 中文

阅读说明:本技术 一种实时空间指向性立体声解码方法 (Real-time space directional stereo decoding method ) 是由 曾子光 曾晓翔 吴云武 王冬雷 慈正宇 于 2020-04-30 设计创作,主要内容包括:本发明具体是一种实时空间指向性立体声解码方法;其特征是,解码方法包括、步骤1、声音对象的创建和控制;步骤2、使用和播放声音对象:步骤3、创建和设置听众对象:步骤4、空间立体声的制作;步骤5、声音解码及播放;步骤6、将音频格式转换为OpenAL可以识别的格式;步骤7、确定声音通道数;步骤8、确定通道对应的音响;步骤9、创建一个udp接收对象接收互动程序发送的位置坐标,将坐标发送给声音对象和观众对象,音频程序获取到声音坐标立即赋值给声音对象位置并播放对应的声音对象即可听到对应位置的声音。本发明提出一种低成本的生成空间中立体音效的方法,从而达到丰富展项内容,提升观众互动体验的目的。(The invention relates to a real-time space directional stereo decoding method; the decoding method is characterized by comprising the following steps of 1, creating and controlling a sound object; step 2, using and playing the sound object: step 3, creating and setting audience objects: step 4, making spatial stereo; step 5, decoding and playing the sound; step 6, converting the audio format into a format which can be identified by OpenAL; step 7, determining the number of sound channels; step 8, determining the sound corresponding to the channel; and 9, creating a position coordinate sent by a udp receiving object receiving interactive program, sending the coordinate to a sound object and an audience object, obtaining the sound coordinate by an audio program, immediately assigning the sound coordinate to the position of the sound object, and playing the corresponding sound object to hear the sound at the corresponding position. The invention provides a method for generating a stereo sound effect in a space with low cost, thereby achieving the purposes of enriching the content of an exhibition item and improving the interactive experience of audiences.)

1. A real-time spatial directional stereo decoding method; the system comprises a PC host with a sound card as a player, and further comprises a power amplifier and a sound component, wherein the power amplifier and the sound component are connected with the PC host through an HDMI (high-definition multimedia interface) wire, and the sound component comprises two front-mounted sounds, two ceiling sounds, two rear-mounted sounds, a middle-mounted sound and a subwoofer; characterized in that the decoding method comprises

Step 1, creating and controlling a sound object: adopting OpenAL to create and manage a sound object, and inputting a space position coordinate to control the sound object;

step 1.1, the concrete realization of the sound object:

1) reading the sound file;

2) reading the sound data into the buffer;

3) reading the sound format;

4) creating an OpenAL context;

5) creating an OpenAL sound object;

6) copying the sound data buffer to the OpenAL sound object;

step 2, using and playing the sound object:

step 2.1, execute with the following code

sound [0] - > setLoop (true)// set loop play sound;

sound [0] - > play (),/play sound;

sound [0] - > setSource (x, y, z)// set sound location, where xyz is the location coordinate of udp message transmission

Step 3, creating and setting audience objects:

step 3.1, execute with the following code

void initListener () {// create audience

float vec[6] = { 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 };

alListenerfv(AL_ORIENTATION, vec);

alListener3f(AL_POSITION, 0.0, 0.0, 0.0);

}

void setListener (float x, float y, float z) {// set listener position

alListener3f(AL_POSITION, x, y, z);

}

Step 4, making spatial stereo, namely performing stereo coding by adopting Steinberg Nuendio 10 coding software and a stereo card;

step 5, decoding and playing the sound;

step 5.1, reading an audio file:

1) reading the sound file to the memory according to the path;

2) obtaining a file header from the read memory;

3) analyzing the sound format according to the file header;

4) analyzing the voice data according to the read content;

5) copying the sound data to the buffer;

step 6, analyzing the audio format: converting audio format to format recognizable by OpenAL

Step 7, determining the number of sound channels by reading nChannels of the sound format;

step 8, reading dwChannelMask in a sound format to determine a sound device corresponding to a channel;

step 9, playing control: and creating a position coordinate sent by a udp receiving object receiving interactive program, sending the coordinate to a sound object and an audience object, and immediately assigning the sound coordinate to the position of the sound object and playing the corresponding sound object by the audio program so as to hear the sound at the corresponding position.

Technical Field

The invention relates to the field of space stereo playing equipment, in particular to a real-time space directional stereo decoding method.

Background

With the development of video and video projection technology, the contents of exhibition items of exhibition halls and the like are extremely rich, and multimedia interactive exhibition items combining videos, sounds, animations and the like become popular. However, most of the traditional expansion terms are dual-channel sound, and the position and the size of the sound are not clear. And thus cannot provide the audience with an immersive experience.

Disclosure of Invention

The invention aims to overcome the defects and provide a method for generating a stereo sound effect in a space with low cost, so that the purposes of enriching the content of an exhibition item and improving the interactive experience of audiences are achieved.

In order to achieve the above object, the present invention is realized by:

a real-time spatial directional stereo decoding method; the system comprises a PC host with a sound card as a player, and further comprises a power amplifier and a sound component, wherein the power amplifier and the sound component are connected with the PC host through an HDMI (high-definition multimedia interface) wire, and the sound component comprises two front-mounted sounds, two ceiling sounds, two rear-mounted sounds, a middle-mounted sound and a subwoofer; characterized in that the decoding method comprises

Step 1, creating and controlling a sound object: adopting OpenAL to create and manage a sound object, and inputting a space position coordinate to control the sound object;

step 1.1, the concrete realization of the sound object:

1) reading the sound file;

2) reading the sound data into the buffer;

3) reading the sound format;

4) creating an OpenAL context;

5) creating an OpenAL sound object;

6) copying the sound data buffer to the OpenAL sound object;

step 2, using and playing the sound object:

step 2.1, execute with the following code

sound [0] - > setLoop (true)// set loop play sound;

sound [0] - > play (),/play sound;

sound [0] - > setSource (x, y, z)// set sound location, where xyz is the location coordinate of udp message transmission

Step 3, creating and setting audience objects:

step 3.1, execute with the following code

void initListener () {// create audience

float vec[6] = { 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 };

alListenerfv(AL_ORIENTATION, vec);

alListener3f(AL_POSITION, 0.0, 0.0, 0.0);

}

void setListener (float x, float y, float z) {// set listener position

alListener3f(AL_POSITION, x, y, z);

}

Step 4, making spatial stereo, namely performing stereo coding by adopting Steinberg Nuendio 10 coding software and a stereo card;

step 5, decoding and playing the sound;

step 5.1, reading an audio file:

1) reading the sound file to the memory according to the path;

2) obtaining a file header from the read memory;

3) analyzing the sound format according to the file header;

4) analyzing the voice data according to the read content;

5) copying the sound data to the buffer;

step 6, analyzing the audio format: converting audio format to format recognizable by OpenAL

Step 7, determining the number of sound channels by reading nChannels of the sound format;

step 8, reading dwChannelMask in a sound format to determine a sound device corresponding to a channel;

step 9, playing control: and creating a position coordinate sent by a udp receiving object receiving interactive program, sending the coordinate to a sound object and an audience object, and immediately assigning the sound coordinate to the position of the sound object and playing the corresponding sound object by the audio program so as to hear the sound at the corresponding position.

The decoding method adopts a multi-channel stereo technology in the field of computers, synthesizes stereo effect through a stereo card, and simultaneously uses a special playing program to take charge of sound decoding so as to generate stereo sound effect in space; the 3d stereo sound effect is creatively applied to the interactive exhibition item, so that the content of the exhibition item is enriched, and the interactive experience of audiences is improved; spatial directional stereo is a new sound scheme, which increases the concept of sound objects compared to common multi-channel sound, creates and moves sound objects in an interactive program, and the sound objects can control the volume of a plurality of sound channels, thereby providing an immersive experience for the audience during interaction.

Drawings

Fig. 1 is a schematic diagram illustrating the operation process of the stereo decoding method.

Detailed Description

The invention is further illustrated by the following specific examples.

As shown in fig. 1, a real-time spatial directional stereo decoding method; the system comprises a PC host with a sound card as a player, and further comprises a power amplifier and a sound component, wherein the power amplifier and the sound component are connected with the PC host through an HDMI (high-definition multimedia interface) wire, and the sound component comprises two front-mounted sounds, two ceiling sounds, two rear-mounted sounds, a middle-mounted sound and a subwoofer; characterized in that the decoding method comprises

Step 1, creating and controlling a sound object: adopting OpenAL to create and manage a sound object, and inputting a space position coordinate to control the sound object;

step 1.1, the concrete realization of the sound object:

1) reading the sound file;

2) reading the sound data into the buffer;

3) reading the sound format;

4) creating an OpenAL context;

5) creating an OpenAL sound object;

6) copying the sound data buffer to the OpenAL sound object;

step 2, using and playing the sound object:

step 2.1, execute with the following code

sound [0] - > setLoop (true)// set loop play sound;

sound [0] - > play (),/play sound;

sound [0] - > setSource (x, y, z)// set sound location, where xyz is the location coordinate of udp message transmission

Step 3, creating and setting audience objects:

step 3.1, execute with the following code

void initListener () {// create audience

float vec[6] = { 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 };

alListenerfv(AL_ORIENTATION, vec);

alListener3f(AL_POSITION, 0.0, 0.0, 0.0);

}

void setListener (float x, float y, float z) {// set listener position

alListener3f(AL_POSITION, x, y, z);

}

Step 4, making spatial stereo, namely performing stereo coding by adopting Steinberg Nuendio 10 coding software and a stereo card;

step 5, decoding and playing the sound;

step 5.1, reading an audio file:

1) reading the sound file to the memory according to the path;

2) obtaining a file header from the read memory;

3) analyzing the sound format according to the file header;

4) analyzing the voice data according to the read content;

5) copying the sound data to the buffer;

step 6, analyzing the audio format: converting audio format to format recognizable by OpenAL

Step 7, determining the number of sound channels by reading nChannels of the sound format;

step 8, reading dwChannelMask in a sound format to determine a sound device corresponding to a channel;

step 9, playing control: and creating a position coordinate sent by a udp receiving object receiving interactive program, sending the coordinate to a sound object and an audience object, and immediately assigning the sound coordinate to the position of the sound object and playing the corresponding sound object by the audio program so as to hear the sound at the corresponding position.

The decoding method adopts a multi-channel stereo technology in the field of computers, synthesizes stereo effect through a stereo card, and simultaneously uses a special playing program to take charge of sound decoding so as to generate stereo sound effect in space; the 3d stereo sound effect is creatively applied to the interactive exhibition item, so that the content of the exhibition item is enriched, and the interactive experience of audiences is improved; spatial directional stereo is a new sound scheme, which increases the concept of sound objects compared to common multi-channel sound, creates and moves sound objects in an interactive program, and the sound objects can control the volume of a plurality of sound channels, thereby providing an immersive experience for the audience during interaction.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种发声装置的控制方法、发声系统以及车辆

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!