WO2018103420A1 - Method and system for storing audio file - Google Patents
Method and system for storing audio file Download PDFInfo
- Publication number
- WO2018103420A1 WO2018103420A1 PCT/CN2017/103458 CN2017103458W WO2018103420A1 WO 2018103420 A1 WO2018103420 A1 WO 2018103420A1 CN 2017103458 W CN2017103458 W CN 2017103458W WO 2018103420 A1 WO2018103420 A1 WO 2018103420A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- audio data
- pcm
- audio file
- audio
- playing
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
- G11B2020/10537—Audio or video recording
- G11B2020/10546—Audio or video recording specifically adapted for audio data
-
- G—PHYSICS
- G11—INFORMATION STORAGE
- G11B—INFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
- G11B20/00—Signal processing not specific to the method of recording or reproducing; Circuits therefor
- G11B20/10—Digital recording or reproducing
- G11B20/10527—Audio or video recording; Data buffering arrangements
- G11B2020/1062—Data buffering arrangements, e.g. recording or playback buffers
- G11B2020/10675—Data buffering arrangements, e.g. recording or playback buffers aspects of buffer control
Definitions
- the present invention relates to the field of audio processing technologies, and in particular, to an audio file storage method and system.
- the storage terminal storing the audio file and the playback terminal playing the audio file are separated from each other, for example, when the audio file in the mobile phone is transmitted to the car Bluetooth player for playback, the audio is The file is stored in the phone and the playback device is set on the car.
- the playback terminal only performs the playback function without storing the audio file.
- the user may need to store the audio file in the playback terminal to play the audio file at any time.
- an audio file needs to be stored in a playback terminal, it is usually required to install specific software on both the playback terminal and the storage terminal.
- the software copies the audio file through a data transmission protocol or a file transfer protocol.
- the storage terminal is transmitted to the playback terminal.
- An audio file storage method includes the following steps:
- the playback device plays the audio data sent by the terminal storing the audio file
- the audio data is synchronously PCM-sampled to obtain PCM audio data, and the PCM audio data is buffered;
- the buffered PCM audio data is compressed according to the set audio file format
- the compressed PCM audio data is stored on a storage medium of the playback device.
- An audio file storage system comprising:
- a cache module configured to: when the playing device plays the audio data sent by the terminal storing the audio file, perform PCM sampling on the audio data to obtain PCM audio data, and cache the PCM audio data;
- a compression module configured to compress the buffered PCM audio data according to the set audio file format when the playing process of the audio data reaches a preset playing end point
- a storage module configured to store the compressed PCM audio data on a storage medium of the playback device.
- the above audio file storage method and system when the playing device plays the audio data, synchronously samples and buffers the audio data, and after the audio data to be buffered is played, the buffered audio data is compressed and stored, and the audio data can be played. At the same time, the audio data is synchronously recorded in the playing terminal, and the audio file can be stored without installing specific software, and the use range is wide, the use flexibility is high, and the audio file playing is not affected, and the audio file can be played while playing the audio file. Storage, high efficiency.
- 1 is a flow chart of an audio file storage method of an embodiment
- FIG. 2 is a schematic structural diagram of an audio file storage system of an embodiment.
- the present invention provides an audio file storage method, which may include the following steps:
- the playback device is separately disposed from the terminal, and the playback device and the terminal are capable of data transmission.
- the playing device may be an audio playing device such as a Bluetooth player
- the terminal may be a smart terminal such as a mobile phone or a tablet computer.
- mobile phones, Smart terminals such as tablets can support the Bluetooth protocol
- the Bluetooth player can also support the Bluetooth protocol. Therefore, the smart terminal and the Bluetooth player can transmit data through the built-in Bluetooth protocol without additional software installation.
- the following uses a Bluetooth player and a mobile phone as an example for description.
- the Bluetooth player can perform PCM sampling of the audio data in synchronization.
- the start and end points of the sample may be pre-set.
- the starting point may be the playing start point of the audio file, that is, the 0th second of the audio file playing; the starting point may also be any playing point in the middle of the audio file, for example, the 10th second, the 25th of the audio file playing Seconds or any other seconds.
- the end point may be the playback end point of the audio file, that is, the last 1 second of the audio file playing, or may be any minute of the first minute 25 seconds, 2 minutes 0 seconds, etc. of the audio file playing.
- the corresponding sampling start point and sampling end point can be set by receiving the time information of the sampling start point and the sampling end point input by the user through the Bluetooth player.
- the integrity of the PCM audio data in the cache can be judged first.
- the PCM audio data in the cache is considered to be incomplete when the following empties occur.
- the first case is that the playback start point of the played audio data is after the preset play start point, and the other case is that the fast forward or fast reverse operation is performed during the process of playing the sound data.
- the initial play progress of the audio data may be compared with a preset sampling start point; if the initial play progress is before the sampling start point, the current play progress reaches the sampling start point. At the time, the audio data is subjected to PCM sampling.
- the user setting is sampling from the 25th second, that is, the user needs audio data starting from the 25th second, and the starting point of the playback is the 30th second, then the 25th The data from the second to the 30th second is missing.
- the complete audio data cannot be obtained. Therefore, if the initial playback progress is after the sampling start point, the corresponding execution may not be performed.
- the audio data is subjected to PCM sampling operation. In order to prevent the second In the case, if a fast forward operation is detected during the playback of the audio data by the playback device, the step of buffering the PCM audio data is stopped, and the PCM audio data in the cache is emptied.
- the audio data is played until the 30th second
- the user performs a fast forward operation
- the audio data starts playing from the 40th second, and the audio between the 30th and 40th seconds.
- the data is missing, so even if the audio data is cached, the complete audio data cannot be obtained. Therefore, if a fast forward operation is detected, an operation of performing PCM sampling on the audio data may not be performed.
- the step of buffering the PCM audio data may also be stopped, and the PCM audio data in the buffer may be emptied.
- the step of buffering the PCM audio data may be stopped, and the fast rewind time is simultaneously recorded, and the PCM audio data is restored when the next playback to the rewind time A step of. In this case, it is necessary to synchronize the audio data at the time of performing the fast reverse operation with the data replayed to the fast reverse time by a time stamp.
- the rewind time can be recorded as the 30th second, and the playback progress of the audio file is returned from the 25 seconds to the 30th second.
- the data from the first play to the 30th second (fast rewind time) and the data from the second play to the 30th second can be synchronized by a time stamp, so that the data obtained by the two samples can be connected.
- the step of buffering the PCM audio data is stopped; and when the playback device detects that the playback process of the audio data is resumed Returning the step of buffering the PCM audio data.
- a pause operation is detected during playback of the audio data by the playback device.
- the step of buffering the PCM audio data is stopped; and when the playback device detects that the playback process of the audio data is resumed.
- music playback may be stopped due to a call received by the mobile phone.
- the audio file storage process is stopped accordingly.
- the audio file storage process can be resumed when the user ends the incoming call and replays the music.
- the counting may also be started from the moment when the pause operation is detected; if the count value reaches the preset count threshold, the detection is detected.
- the playback device resumes the playing process of the audio data, and returns a step of buffering the PCM audio data. In this way, it is possible to prevent incomplete audio data from occupying the cache space for a long time.
- the auto save mode When saving an audio file, you can set two modes, one is the auto save mode and the other is the manual save mode.
- the automatic save mode as long as the audio data selected by the user is cached, it is automatically compressed and stored.
- the audio data selected by the above user refers to the audio data between the start point and the end point in step S1.
- the manual save mode the user can manually select whether to cache the audio data. Specifically, a store instruction for the PCM audio data may be received; the cached PCM audio data is compressed in response to the store instruction.
- a dialog box may be displayed on the display screen, which may include options, for example, including a determination option and a cancellation option, if the user clicks on the confirmation option, The cached PCM audio data is compressed. If the user clicks the cancel option, the cached PCM audio data is not compressed, and the PCM audio data in the cache can be emptied to avoid long-term occupation of the cache space by the data that the user does not need.
- the dialog box may be exited and the operation of compressing the cached PCM audio data may be performed.
- the category information of the audio file may also be acquired; the category information is associated with the compressed PCM audio data to obtain association information; and the association information is stored on a storage medium of the playback device.
- the category information may include a type of sound in the audio file (eg, wind, bird, erhu, piano, etc.), or a name of the utterer (eg, when the audio file is a song, the category information) It can be the name of the singer, the production time of the audio file, the format of the audio file (for example, mp3 format), the name of the audio file, and the like.
- the above category information may be manually input by the user, or may be automatically transmitted from the terminal storing the audio file to the audio playback device through a corresponding protocol.
- the mobile phone and the Bluetooth player can communicate via the Bluetooth A2DP protocol (Advanced Audio Distribution Profile), through which the Bluetooth player can learn the singer of the currently playing song.
- Name and song The title of the song, in one embodiment, the category information of the song can be saved in a similar manner as "singer name-song name.mp3" or the like.
- an audio file storage system which may include:
- the cache module 10 is configured to perform PCM (Pulse Coded Modulation) sampling on the audio data synchronously when playing the audio data sent by the terminal that stores the audio file, to obtain PCM audio data, and to the PCM Audio data is cached;
- PCM Pulse Coded Modulation
- the playback device is separately disposed from the terminal, and the playback device and the terminal are capable of data transmission.
- the playing device may be an audio playing device such as a Bluetooth player
- the terminal may be a smart terminal such as a mobile phone or a tablet computer.
- smart terminals such as mobile phones and tablet computers can support the Bluetooth protocol
- the Bluetooth player can also support the Bluetooth protocol. Therefore, the smart terminal and the Bluetooth player can transmit data through the built-in Bluetooth protocol without Additional installation of specific software.
- the following uses a Bluetooth player and a mobile phone as an example for description.
- the Bluetooth player can perform PCM sampling of the audio data in synchronization.
- the start and end points of the sample may be pre-set.
- the starting point may be the playing start point of the audio file, that is, the 0th second of the audio file playing; the starting point may also be any playing point in the middle of the audio file, for example, the 10th second, the 25th of the audio file playing Seconds or any other seconds.
- the end point may be the playback end point of the audio file, that is, the last 1 second of the audio file playing, or may be any minute of the first minute 25 seconds, 2 minutes 0 seconds, etc. of the audio file playing.
- the corresponding sampling start point and sampling end point can be set by receiving the time information of the sampling start point and the sampling end point input by the user through the Bluetooth player.
- the integrity of the PCM audio data in the cache can be judged first.
- the PCM audio data in the cache is considered to be incomplete when the following empties occur.
- the first case is that the playback start point of the played audio data is after the preset play start point, and the other case is that the fast forward or fast reverse operation is performed during the process of playing the sound data.
- the initial play progress of the audio data may be compared with a preset sampling start point; if the initial play progress is before the sampling start point, the current play progress reaches the sampling start point. At the time, the audio data is subjected to PCM sampling.
- the user setting is sampling from the 25th second, that is, the user needs audio data starting from the 25th second, and the starting point of the playback is the 30th second, then the 25th The data from the second to the 30th second is missing.
- the complete audio data cannot be obtained. Therefore, if the initial playback progress is after the sampling start point, the corresponding execution may not be performed.
- the audio data is subjected to PCM sampling operation. In order to prevent the second situation, if a fast forward operation is detected during the playback of the audio data by the playback device, the function of buffering the PCM audio data is stopped, and the PCM audio data in the buffer is emptied.
- the audio data is played until the 30th second
- the user performs a fast forward operation
- the audio data starts playing from the 40th second, and the audio between the 30th and 40th seconds.
- the data is missing, so even if the audio data is cached, the complete audio data cannot be obtained. Therefore, if a fast forward operation is detected, an operation of performing PCM sampling on the audio data may not be performed.
- the function of buffering the PCM audio data may also be stopped, and the PCM audio data in the buffer may be emptied.
- the function of buffering the PCM audio data may be stopped, and the fast rewind time is simultaneously recorded, and the PCM audio data is resumed when the next playback to the rewind time The function of caching. In this case, it is necessary to synchronize the audio data at the time of performing the fast reverse operation with the data replayed to the fast reverse time by a time stamp.
- the rewind time can be recorded as the 30th second, and the playback progress of the audio file is returned from the 25 seconds to the 30th second.
- the data from the first play to the 30th second (fast rewind time) and the data from the second play to the 30th second can be synchronized by a time stamp, so that the data obtained by the two samples can be connected.
- the function of buffering the PCM audio data is stopped; when the playback device pair is detected When the playing process of the audio data is restored, a function of buffering the PCM audio data is returned.
- a function of buffering the PCM audio data is returned. For example, in actual situations, when a user plays an audio file stored in a mobile phone through a Bluetooth player, music playback may be stopped due to a call received by the mobile phone. At this point, the audio file storage process is stopped accordingly. The audio file storage process can be resumed when the user ends the incoming call and replays the music.
- the counting may also be started from the moment when the pause operation is detected; if the count value reaches the preset count threshold, the detection is detected.
- the playback device resumes the playing process of the audio data, and returns a function of buffering the PCM audio data. In this way, it is possible to prevent incomplete audio data from occupying the cache space for a long time.
- the compression module 20 is configured to compress the buffered PCM audio data according to the set audio file format when the playing process of the audio data reaches a preset playing end point;
- the auto save mode When saving an audio file, you can set two modes, one is the auto save mode and the other is the manual save mode.
- the automatic save mode as long as the audio data selected by the user is cached, it is automatically compressed and stored.
- the audio data selected by the above user refers to the audio data between the start point and the end point in the cache module 10.
- the manual save mode the user can manually select whether to cache the audio data. Specifically, a store instruction for the PCM audio data may be received; the cached PCM audio data is compressed in response to the store instruction.
- a dialog box may be displayed on the display screen, which may include options, for example, including a determination option and a cancellation option, if the user clicks on the confirmation option, The cached PCM audio data is compressed. If the user clicks the cancel option, the cached PCM audio data is not compressed, and the PCM audio data in the cache can be emptied to avoid long-term occupation of the cache space by the data that the user does not need.
- the dialog box may be exited and the operation of compressing the cached PCM audio data may be performed.
- the storage module 30 is configured to store the compressed PCM audio data on a storage medium of the playback device.
- the category information of the audio file may also be acquired; the category information is associated with the compressed PCM audio data to obtain association information; and the association information is stored on a storage medium of the playback device.
- the category information may include a type of sound in the audio file (eg, wind, bird, erhu, piano, etc.), or a name of the utterer (eg, when the audio file is a song, the category information) It can be the name of the singer, the production time of the audio file, the format of the audio file (for example, mp3 format), the name of the audio file, and the like.
- the above category information may be manually input by the user, or may be automatically transmitted from the terminal storing the audio file to the audio playback device through a corresponding protocol.
- the mobile phone and the Bluetooth player can communicate via the Bluetooth A2DP protocol (Advanced Audio Distribution Profile), through which the Bluetooth player can learn the singer of the currently playing song.
- Name and song name in one embodiment, the category information of the song can be saved in a similar manner as "singer name-song name.mp3" or the like.
- the above audio file storage method and system when the playing device plays the audio data, synchronously samples and buffers the audio data, and after the audio data to be buffered is played, the buffered audio data is compressed and stored, and the audio data can be played. At the same time, the audio data is synchronously recorded in the playing terminal, and the audio file can be stored without installing specific software, and the use range is wide, the use flexibility is high, and the audio file playing is not affected, and the audio file can be played while playing the audio file. Storage, high efficiency.
- the audio file storage system of the present invention has a one-to-one correspondence with the audio file storage method of the present invention, and the technical features and the beneficial effects thereof described in the embodiments of the audio file storage method are applicable to the embodiment of the audio file storage system, and hereby declare .
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The present invention relates to a method and system for storing an audio file. The method comprises: when a playing apparatus is playing audio data transmitted by a terminal storing an audio file, synchronously performing PCM sampling on the audio data to obtain PCM audio data, and caching the PCM audio data (S1); when a playing progress with respect to the audio data reaches a preset end point, performing compression on the cached PCM audio data according to a set audio file format (S2); and storing the compressed PCM audio data in a storage medium of the playing apparatus (S3). The method and system for storing an audio file of the present invention have a wide range of applications, and can be used flexibility without affecting playing of an audio file. The present invention can play and store an audio file at the same time, and thus has high efficiency.
Description
本发明涉及音频处理技术领域,特别是涉及一种音频文件存储方法和系统。The present invention relates to the field of audio processing technologies, and in particular, to an audio file storage method and system.
在播放音频文件时,有一种场景是存储音频文件的存储终端与播放音频文件的播放终端是相互分离的两个终端,例如,将手机中的音频文件传输到车载蓝牙播放器进行播放时,音频文件存储在手机中,播放设备设置在车载端。在这种情况下,播放终端只执行播放功能,而不会对音频文件进行存储。然而,在实际应用中,用户可能需要将音频文件存储在播放终端中,以便随时播放音频文件。When playing an audio file, there is a scene in which the storage terminal storing the audio file and the playback terminal playing the audio file are separated from each other, for example, when the audio file in the mobile phone is transmitted to the car Bluetooth player for playback, the audio is The file is stored in the phone and the playback device is set on the car. In this case, the playback terminal only performs the playback function without storing the audio file. However, in practical applications, the user may need to store the audio file in the playback terminal to play the audio file at any time.
在传统技术中,如果需要将音频文件存储在播放终端中,通常需要在播放终端与存储终端都安装特定的软件,在传输时,该软件通过某种数据传输协议或者文件传输协议将音频文件从存储终端传输到播放终端。In the conventional technology, if an audio file needs to be stored in a playback terminal, it is usually required to install specific software on both the playback terminal and the storage terminal. When transmitting, the software copies the audio file through a data transmission protocol or a file transfer protocol. The storage terminal is transmitted to the playback terminal.
然而,上述方式需要存储终端与播放终端均安装能够支持相同数据传输协议或者文件传输协议的软件,使用灵活性较差。However, the above method requires that both the storage terminal and the playback terminal install software capable of supporting the same data transmission protocol or file transfer protocol, and the use flexibility is poor.
发明内容Summary of the invention
基于此,有必要针对使用灵活性较差的问题,提供一种音频文件存储方法和系统。Based on this, it is necessary to provide an audio file storage method and system for the problem of poor use flexibility.
一种音频文件存储方法,包括以下步骤:An audio file storage method includes the following steps:
在播放设备播放存储音频文件的终端发送的音频数据时,同步地对所述音频数据进行PCM采样,得到PCM音频数据,对所述PCM音频数据进行缓存;When the playback device plays the audio data sent by the terminal storing the audio file, the audio data is synchronously PCM-sampled to obtain PCM audio data, and the PCM audio data is buffered;
在对所述音频数据的播放进程到达预设的播放终点时,根据设定的音频文件格式对缓存的PCM音频数据进行压缩;
When the playing process of the audio data reaches a preset playing end point, the buffered PCM audio data is compressed according to the set audio file format;
将压缩的PCM音频数据存储在播放设备的存储介质上。The compressed PCM audio data is stored on a storage medium of the playback device.
一种音频文件存储系统,包括:An audio file storage system comprising:
缓存模块,用于在播放设备播放存储音频文件的终端发送的音频数据时,同步地对所述音频数据进行PCM采样,得到PCM音频数据,对所述PCM音频数据进行缓存;a cache module, configured to: when the playing device plays the audio data sent by the terminal storing the audio file, perform PCM sampling on the audio data to obtain PCM audio data, and cache the PCM audio data;
压缩模块,用于在对所述音频数据的播放进程到达预设的播放终点时,根据设定的音频文件格式对缓存的PCM音频数据进行压缩;a compression module, configured to compress the buffered PCM audio data according to the set audio file format when the playing process of the audio data reaches a preset playing end point;
存储模块,用于将压缩的PCM音频数据存储在播放设备的存储介质上。And a storage module, configured to store the compressed PCM audio data on a storage medium of the playback device.
上述音频文件存储方法和系统,在播放设备播放音频数据时,同步对音频数据进行采样、缓存,在需要缓存的音频数据播放完成之后,将缓存的音频数据进行压缩存储,能够在播放音频数据的同时在播放终端对音频数据进行同步录制,无需安装特定软件就能对音频文件进行存储,使用范围广,使用灵活性高,且不影响音频文件播放,能够在播放音频文件的同时对音频文件进行存储,效率高。The above audio file storage method and system, when the playing device plays the audio data, synchronously samples and buffers the audio data, and after the audio data to be buffered is played, the buffered audio data is compressed and stored, and the audio data can be played. At the same time, the audio data is synchronously recorded in the playing terminal, and the audio file can be stored without installing specific software, and the use range is wide, the use flexibility is high, and the audio file playing is not affected, and the audio file can be played while playing the audio file. Storage, high efficiency.
图1为一个实施例的音频文件存储方法流程图;1 is a flow chart of an audio file storage method of an embodiment;
图2为一个实施例的音频文件存储系统的结构示意图。2 is a schematic structural diagram of an audio file storage system of an embodiment.
下面结合附图对本发明的技术方案进行说明。The technical solution of the present invention will be described below with reference to the accompanying drawings.
如图1所示,本发明提供一种音频文件存储方法,可包括以下步骤:As shown in FIG. 1, the present invention provides an audio file storage method, which may include the following steps:
S1,在播放设备播放存储音频文件的终端发送的音频数据时,同步地对所述音频数据进行PCM(Pulse Coded Modulation,脉冲编码调制)采样,得到PCM音频数据,对所述PCM音频数据进行缓存;S1, when the playback device plays the audio data sent by the terminal storing the audio file, synchronously PCM (Pulse Coded Modulation) sampling is performed on the audio data to obtain PCM audio data, and the PCM audio data is cached. ;
其中,所述播放设备与所述终端分离设置,且所述播放设备与所述终端能够进行数据传输。在一个实施例中,所述播放设备可以是蓝牙播放器等音频播放设备,所述终端可以是手机、平板电脑等智能终端。一般而言,手机、
平板电脑等智能终端都能够支持蓝牙协议,蓝牙播放器也能够支持蓝牙协议,因此,所述智能终端与所述蓝牙播放器可通过自带的蓝牙协议进行数据传输,无需额外安装特定软件。为了便于描述,下面以蓝牙播放器和手机为例进行说明。The playback device is separately disposed from the terminal, and the playback device and the terminal are capable of data transmission. In an embodiment, the playing device may be an audio playing device such as a Bluetooth player, and the terminal may be a smart terminal such as a mobile phone or a tablet computer. In general, mobile phones,
Smart terminals such as tablets can support the Bluetooth protocol, and the Bluetooth player can also support the Bluetooth protocol. Therefore, the smart terminal and the Bluetooth player can transmit data through the built-in Bluetooth protocol without additional software installation. For convenience of description, the following uses a Bluetooth player and a mobile phone as an example for description.
在蓝牙播放器播放手机中存储的所述音频数据时,蓝牙播放器可以同步地对音频数据进行PCM采样。在一个实施例中,可以预先设置采样的起点和终点。例如,所述起点可以是音频文件的播放起始点,即音频文件播放的第0秒;所述起点也可以是音频文件中间的任意一个播放点,例如,音频文件播放的第10秒、第25秒或其他任意秒。同样地,所述终点可以是音频文件的播放终止点,即音频文件播放的最后1秒,也可以是音频文件播放的第1分25秒,2分0秒等任意秒。可以通过蓝牙播放器接收用户输入的采样起点和采样终点的时间信息来设置相应的采样起点和采样终点。通过这种方式,可以灵活地选择需要存储的音频文件或音频文件的一部分。例如,有时候用户只需要把一首歌曲中的前奏部分保存下来,这时候,通过将采样的起点和终点设置为前奏部分的起点和终点就可以实现这一功能。又例如,有时候用户需要把整首歌曲都保存下来,只需将采样的起点和终点设置为整首歌曲的起点和终点。When the Bluetooth player plays the audio data stored in the mobile phone, the Bluetooth player can perform PCM sampling of the audio data in synchronization. In one embodiment, the start and end points of the sample may be pre-set. For example, the starting point may be the playing start point of the audio file, that is, the 0th second of the audio file playing; the starting point may also be any playing point in the middle of the audio file, for example, the 10th second, the 25th of the audio file playing Seconds or any other seconds. Similarly, the end point may be the playback end point of the audio file, that is, the last 1 second of the audio file playing, or may be any minute of the first minute 25 seconds, 2 minutes 0 seconds, etc. of the audio file playing. The corresponding sampling start point and sampling end point can be set by receiving the time information of the sampling start point and the sampling end point input by the user through the Bluetooth player. In this way, you have the flexibility to choose which part of the audio file or audio file you want to store. For example, sometimes the user only needs to save the intro part of a song. This is done by setting the start and end points of the sample to the start and end points of the intro section. For another example, sometimes the user needs to save the entire song, just set the start and end points of the sample to the start and end points of the entire song.
在进行存储时,可先对缓存中的PCM音频数据的完整性进行判断。一般而言,当出现以下几种清空时,可认为缓存中的PCM音频数据是不完整的。第一种情况是播放音频数据的播放起点在预设的播放起点之后,另一种情况是播放音数据的过程中执行了快进或快退操作。为了防止第一种情形,可以将所述音频数据的起始播放进度与预设的采样起点进行比较;若所述起始播放进度在所述采样起点之前,在当前播放进度到达所述采样起点时,对所述音频数据进行PCM采样。举例来说,在第一种情况下,假设用户设定是从第25秒开始采样,即,用户需要的是从第25秒开始的音频数据,而播放的起点是第30秒,则第25秒至第30秒的数据是缺失的,此时,即便从第30秒开始缓存,也无法得到完整的音频数据,因此,若所述起始播放进度在所述采样起点之后,可不执行对所述音频数据进行PCM采样的操作。为了防止第二
种情形,若在播放设备播放所述音频数据的过程中检测到快进操作操作,停止对所述PCM音频数据进行缓存的步骤,并将缓存中的PCM音频数据清空。在第二种情况下,假设音频数据播放到第30秒时,用户执行了快进操作,执行快进操作后音频数据从第40秒开始播放,则第30秒至第40秒之间的音频数据是缺失的,因此,即便对音频数据进行缓存,也无法得到完整的音频数据。因此,若检测到快进操作,可不执行对所述音频数据进行PCM采样的操作。When storing, the integrity of the PCM audio data in the cache can be judged first. In general, the PCM audio data in the cache is considered to be incomplete when the following empties occur. The first case is that the playback start point of the played audio data is after the preset play start point, and the other case is that the fast forward or fast reverse operation is performed during the process of playing the sound data. In order to prevent the first situation, the initial play progress of the audio data may be compared with a preset sampling start point; if the initial play progress is before the sampling start point, the current play progress reaches the sampling start point. At the time, the audio data is subjected to PCM sampling. For example, in the first case, assume that the user setting is sampling from the 25th second, that is, the user needs audio data starting from the 25th second, and the starting point of the playback is the 30th second, then the 25th The data from the second to the 30th second is missing. At this time, even if the buffer starts from the 30th second, the complete audio data cannot be obtained. Therefore, if the initial playback progress is after the sampling start point, the corresponding execution may not be performed. The audio data is subjected to PCM sampling operation. In order to prevent the second
In the case, if a fast forward operation is detected during the playback of the audio data by the playback device, the step of buffering the PCM audio data is stopped, and the PCM audio data in the cache is emptied. In the second case, assuming that the audio data is played until the 30th second, the user performs a fast forward operation, and after the fast forward operation, the audio data starts playing from the 40th second, and the audio between the 30th and 40th seconds. The data is missing, so even if the audio data is cached, the complete audio data cannot be obtained. Therefore, if a fast forward operation is detected, an operation of performing PCM sampling on the audio data may not be performed.
同理,在检测到快退操作时,也可以停止对所述PCM音频数据进行缓存的步骤,并将缓存中的PCM音频数据清空。或者,在检测到快进操作的同时,可以停止对所述PCM音频数据进行缓存的步骤,并同时记录快退时刻,在下一次播放到该快退时刻时,恢复对所述PCM音频数据进行缓存的步骤。在这种情况下,需要通过一个时间戳对执行快退操作的时刻的音频数据与重新播放到快退时刻的数据进行同步。举例来说,在第30秒时执行了快退操作,音频文件播放进度回到第25秒,则可以记录快退时刻为第30秒,当音频文件的播放进度从25秒回到第30秒时,可重新进行采样操作。可通过一个时间戳对第一次播放到第30秒时(快退时刻)的数据与第二次播放到第30秒时的数据进行同步,使两次采样得到的数据能够衔接上。Similarly, when the fast rewind operation is detected, the step of buffering the PCM audio data may also be stopped, and the PCM audio data in the buffer may be emptied. Alternatively, while the fast forward operation is detected, the step of buffering the PCM audio data may be stopped, and the fast rewind time is simultaneously recorded, and the PCM audio data is restored when the next playback to the rewind time A step of. In this case, it is necessary to synchronize the audio data at the time of performing the fast reverse operation with the data replayed to the fast reverse time by a time stamp. For example, when the rewind operation is performed at the 30th second and the audio file playback progresses back to the 25th second, the rewind time can be recorded as the 30th second, and the playback progress of the audio file is returned from the 25 seconds to the 30th second. When you can re-sampling. The data from the first play to the 30th second (fast rewind time) and the data from the second play to the 30th second can be synchronized by a time stamp, so that the data obtained by the two samples can be connected.
在一个实施例中,若在播放设备播放所述音频数据的过程中检测到暂停操作,停止对所述PCM音频数据进行缓存的步骤;在检测到播放设备对所述音频数据的播放进程恢复时,返回对所述PCM音频数据进行缓存的步骤。例如,在实际情况下,用户通过蓝牙播放器播放手机中存储的音频文件时,可能会因手机接到来电而导致音乐播放停止。此时,音频文件存储过程也相应停止。在用户结束来电通话,并重新播放音乐时,可恢复音频文件存储过程。在另一个实施例中,在播放设备播放所述音频数据的过程中检测到暂停操作之后,还可以从检测到暂停操作的时刻开始计数;若在计数值达到预设的计数阈值之前,检测到播放设备对所述音频数据的播放进程恢复,返回对所述PCM音频数据进行缓存的步骤。通过这种方式,可以避免不完整的音频数据长期占有缓存空间。
In one embodiment, if a pause operation is detected during playback of the audio data by the playback device, the step of buffering the PCM audio data is stopped; and when the playback device detects that the playback process of the audio data is resumed Returning the step of buffering the PCM audio data. For example, in actual situations, when a user plays an audio file stored in a mobile phone through a Bluetooth player, music playback may be stopped due to a call received by the mobile phone. At this point, the audio file storage process is stopped accordingly. The audio file storage process can be resumed when the user ends the incoming call and replays the music. In another embodiment, after the pause operation is detected in the process of playing the audio data by the playback device, the counting may also be started from the moment when the pause operation is detected; if the count value reaches the preset count threshold, the detection is detected. The playback device resumes the playing process of the audio data, and returns a step of buffering the PCM audio data. In this way, it is possible to prevent incomplete audio data from occupying the cache space for a long time.
值得一提的是,上述步骤以及本发明的以下各个步骤可以由蓝牙播放器执行,也可以由其他控制器或处理器等设备来实现。It is worth mentioning that the above steps and the following steps of the present invention may be performed by a Bluetooth player, or may be implemented by other controllers or processors.
S2,在对所述音频数据的播放进程到达预设的播放终点时,根据设定的音频文件格式对缓存的PCM音频数据进行压缩;S2, when the playing process of the audio data reaches a preset playing end point, compressing the buffered PCM audio data according to the set audio file format;
在保存音频文件时,可以设置两种模式,一种是自动保存模式,另一种是手动保存模式。在自动保存模式下,只要用户选中的音频数据缓存完毕,即自动进行压缩并存储。上述用户选中的音频数据是指步骤S1中所述起点和终点之间的音频数据。在手动保存模式下,可以由用户手动选择是否对音频数据进行缓存。具体地,可以接收对所述PCM音频数据的存储指令;响应所述存储指令对缓存的PCM音频数据进行压缩。如果所述蓝牙播放器具有人机交互界面(例如,显示屏),可在显示屏上显示一个对话框,该对话框中可包括选项,例如,包括确定选项和取消选项,如果用户点击确认选项,则对缓存的PCM音频数据进行压缩,如果用户点击取消选项,则不对缓存的PCM音频数据进行压缩,并可将缓存中的PCM音频数据清空,以避免用户不需要的数据长期占有缓存空间。在一个实施例中,弹出对话框后,若一段时间内用户没有选择对话框中的选项,可以退出该对话框,并执行对缓存的PCM音频数据进行压缩的操作。When saving an audio file, you can set two modes, one is the auto save mode and the other is the manual save mode. In the automatic save mode, as long as the audio data selected by the user is cached, it is automatically compressed and stored. The audio data selected by the above user refers to the audio data between the start point and the end point in step S1. In the manual save mode, the user can manually select whether to cache the audio data. Specifically, a store instruction for the PCM audio data may be received; the cached PCM audio data is compressed in response to the store instruction. If the Bluetooth player has a human-computer interaction interface (eg, a display screen), a dialog box may be displayed on the display screen, which may include options, for example, including a determination option and a cancellation option, if the user clicks on the confirmation option, The cached PCM audio data is compressed. If the user clicks the cancel option, the cached PCM audio data is not compressed, and the PCM audio data in the cache can be emptied to avoid long-term occupation of the cache space by the data that the user does not need. In one embodiment, after the dialog box is popped up, if the user does not select an option in the dialog box for a period of time, the dialog box may be exited and the operation of compressing the cached PCM audio data may be performed.
S3,将压缩的PCM音频数据存储在播放设备的存储介质上。S3. Store the compressed PCM audio data on a storage medium of the playback device.
在一个实施例中,还可以获取所述音频文件的类别信息;将所述类别信息与压缩的PCM音频数据进行关联,得到关联信息;将所述关联信息存储在播放设备的存储介质上。其中,所述类别信息可以包括所述音频文件中的声音的种类(例如,风声、鸟兽声、二胡、钢琴等),或者发声者的姓名(例如,当音频文件是歌曲时,该类别信息可以是歌手的姓名)、音频文件的制作时间、音频文件的格式(例如,mp3格式)、音频文件的名称等。上述类别信息可以由用户手动输入,也可以通过相应的协议从存储音频文件的终端自动传输到音频播放设备。例如,以手机和蓝牙播放器为例,手机和蓝牙播放器可通过蓝牙A2DP协议(Advanced Audio Distribution Profile蓝牙音频传输模型协定)进行通信,通过该协议,蓝牙播放器可以获知当前播放的歌曲的歌手名和歌
曲名,在一个实施例中,可以将歌曲的类别信息以"歌手名-歌曲名.mp3"等类似的方式进行保存。In an embodiment, the category information of the audio file may also be acquired; the category information is associated with the compressed PCM audio data to obtain association information; and the association information is stored on a storage medium of the playback device. The category information may include a type of sound in the audio file (eg, wind, bird, erhu, piano, etc.), or a name of the utterer (eg, when the audio file is a song, the category information) It can be the name of the singer, the production time of the audio file, the format of the audio file (for example, mp3 format), the name of the audio file, and the like. The above category information may be manually input by the user, or may be automatically transmitted from the terminal storing the audio file to the audio playback device through a corresponding protocol. For example, in the case of a mobile phone and a Bluetooth player, the mobile phone and the Bluetooth player can communicate via the Bluetooth A2DP protocol (Advanced Audio Distribution Profile), through which the Bluetooth player can learn the singer of the currently playing song. Name and song
The title of the song, in one embodiment, the category information of the song can be saved in a similar manner as "singer name-song name.mp3" or the like.
如图2所示,本发明提供一种音频文件存储系统,可包括:As shown in FIG. 2, the present invention provides an audio file storage system, which may include:
缓存模块10,用于在播放设备播放存储音频文件的终端发送的音频数据时,同步地对所述音频数据进行PCM(Pulse Coded Modulation,脉冲编码调制)采样,得到PCM音频数据,对所述PCM音频数据进行缓存;The cache module 10 is configured to perform PCM (Pulse Coded Modulation) sampling on the audio data synchronously when playing the audio data sent by the terminal that stores the audio file, to obtain PCM audio data, and to the PCM Audio data is cached;
其中,所述播放设备与所述终端分离设置,且所述播放设备与所述终端能够进行数据传输。在一个实施例中,所述播放设备可以是蓝牙播放器等音频播放设备,所述终端可以是手机、平板电脑等智能终端。一般而言,手机、平板电脑等智能终端都能够支持蓝牙协议,蓝牙播放器也能够支持蓝牙协议,因此,所述智能终端与所述蓝牙播放器可通过自带的蓝牙协议进行数据传输,无需额外安装特定软件。为了便于描述,下面以蓝牙播放器和手机为例进行说明。The playback device is separately disposed from the terminal, and the playback device and the terminal are capable of data transmission. In an embodiment, the playing device may be an audio playing device such as a Bluetooth player, and the terminal may be a smart terminal such as a mobile phone or a tablet computer. In general, smart terminals such as mobile phones and tablet computers can support the Bluetooth protocol, and the Bluetooth player can also support the Bluetooth protocol. Therefore, the smart terminal and the Bluetooth player can transmit data through the built-in Bluetooth protocol without Additional installation of specific software. For convenience of description, the following uses a Bluetooth player and a mobile phone as an example for description.
在蓝牙播放器播放手机中存储的所述音频数据时,蓝牙播放器可以同步地对音频数据进行PCM采样。在一个实施例中,可以预先设置采样的起点和终点。例如,所述起点可以是音频文件的播放起始点,即音频文件播放的第0秒;所述起点也可以是音频文件中间的任意一个播放点,例如,音频文件播放的第10秒、第25秒或其他任意秒。同样地,所述终点可以是音频文件的播放终止点,即音频文件播放的最后1秒,也可以是音频文件播放的第1分25秒,2分0秒等任意秒。可以通过蓝牙播放器接收用户输入的采样起点和采样终点的时间信息来设置相应的采样起点和采样终点。通过这种方式,可以灵活地选择需要存储的音频文件或音频文件的一部分。例如,有时候用户只需要把一首歌曲中的前奏部分保存下来,这时候,通过将采样的起点和终点设置为前奏部分的起点和终点就可以实现这一功能。又例如,有时候用户需要把整首歌曲都保存下来,只需将采样的起点和终点设置为整首歌曲的起点和终点。When the Bluetooth player plays the audio data stored in the mobile phone, the Bluetooth player can perform PCM sampling of the audio data in synchronization. In one embodiment, the start and end points of the sample may be pre-set. For example, the starting point may be the playing start point of the audio file, that is, the 0th second of the audio file playing; the starting point may also be any playing point in the middle of the audio file, for example, the 10th second, the 25th of the audio file playing Seconds or any other seconds. Similarly, the end point may be the playback end point of the audio file, that is, the last 1 second of the audio file playing, or may be any minute of the first minute 25 seconds, 2 minutes 0 seconds, etc. of the audio file playing. The corresponding sampling start point and sampling end point can be set by receiving the time information of the sampling start point and the sampling end point input by the user through the Bluetooth player. In this way, you have the flexibility to choose which part of the audio file or audio file you want to store. For example, sometimes the user only needs to save the intro part of a song. This is done by setting the start and end points of the sample to the start and end points of the intro section. For another example, sometimes the user needs to save the entire song, just set the start and end points of the sample to the start and end points of the entire song.
在进行存储时,可先对缓存中的PCM音频数据的完整性进行判断。一般而言,当出现以下几种清空时,可认为缓存中的PCM音频数据是不完整的。
第一种情况是播放音频数据的播放起点在预设的播放起点之后,另一种情况是播放音数据的过程中执行了快进或快退操作。为了防止第一种情形,可以将所述音频数据的起始播放进度与预设的采样起点进行比较;若所述起始播放进度在所述采样起点之前,在当前播放进度到达所述采样起点时,对所述音频数据进行PCM采样。举例来说,在第一种情况下,假设用户设定是从第25秒开始采样,即,用户需要的是从第25秒开始的音频数据,而播放的起点是第30秒,则第25秒至第30秒的数据是缺失的,此时,即便从第30秒开始缓存,也无法得到完整的音频数据,因此,若所述起始播放进度在所述采样起点之后,可不执行对所述音频数据进行PCM采样的操作。为了防止第二种情形,若在播放设备播放所述音频数据的过程中检测到快进操作操作,停止对所述PCM音频数据进行缓存的功能,并将缓存中的PCM音频数据清空。在第二种情况下,假设音频数据播放到第30秒时,用户执行了快进操作,执行快进操作后音频数据从第40秒开始播放,则第30秒至第40秒之间的音频数据是缺失的,因此,即便对音频数据进行缓存,也无法得到完整的音频数据。因此,若检测到快进操作,可不执行对所述音频数据进行PCM采样的操作。When storing, the integrity of the PCM audio data in the cache can be judged first. In general, the PCM audio data in the cache is considered to be incomplete when the following empties occur.
The first case is that the playback start point of the played audio data is after the preset play start point, and the other case is that the fast forward or fast reverse operation is performed during the process of playing the sound data. In order to prevent the first situation, the initial play progress of the audio data may be compared with a preset sampling start point; if the initial play progress is before the sampling start point, the current play progress reaches the sampling start point. At the time, the audio data is subjected to PCM sampling. For example, in the first case, assume that the user setting is sampling from the 25th second, that is, the user needs audio data starting from the 25th second, and the starting point of the playback is the 30th second, then the 25th The data from the second to the 30th second is missing. At this time, even if the buffer starts from the 30th second, the complete audio data cannot be obtained. Therefore, if the initial playback progress is after the sampling start point, the corresponding execution may not be performed. The audio data is subjected to PCM sampling operation. In order to prevent the second situation, if a fast forward operation is detected during the playback of the audio data by the playback device, the function of buffering the PCM audio data is stopped, and the PCM audio data in the buffer is emptied. In the second case, assuming that the audio data is played until the 30th second, the user performs a fast forward operation, and after the fast forward operation, the audio data starts playing from the 40th second, and the audio between the 30th and 40th seconds. The data is missing, so even if the audio data is cached, the complete audio data cannot be obtained. Therefore, if a fast forward operation is detected, an operation of performing PCM sampling on the audio data may not be performed.
同理,在检测到快退操作时,也可以停止对所述PCM音频数据进行缓存的功能,并将缓存中的PCM音频数据清空。或者,在检测到快进操作的同时,可以停止执行对所述PCM音频数据进行缓存的功能,并同时记录快退时刻,在下一次播放到该快退时刻时,恢复对所述PCM音频数据进行缓存的功能。在这种情况下,需要通过一个时间戳对执行快退操作的时刻的音频数据与重新播放到快退时刻的数据进行同步。举例来说,在第30秒时执行了快退操作,音频文件播放进度回到第25秒,则可以记录快退时刻为第30秒,当音频文件的播放进度从25秒回到第30秒时,可重新进行采样操作。可通过一个时间戳对第一次播放到第30秒时(快退时刻)的数据与第二次播放到第30秒时的数据进行同步,使两次采样得到的数据能够衔接上。Similarly, when the fast rewind operation is detected, the function of buffering the PCM audio data may also be stopped, and the PCM audio data in the buffer may be emptied. Alternatively, while the fast forward operation is detected, the function of buffering the PCM audio data may be stopped, and the fast rewind time is simultaneously recorded, and the PCM audio data is resumed when the next playback to the rewind time The function of caching. In this case, it is necessary to synchronize the audio data at the time of performing the fast reverse operation with the data replayed to the fast reverse time by a time stamp. For example, when the rewind operation is performed at the 30th second and the audio file playback progresses back to the 25th second, the rewind time can be recorded as the 30th second, and the playback progress of the audio file is returned from the 25 seconds to the 30th second. When you can re-sampling. The data from the first play to the 30th second (fast rewind time) and the data from the second play to the 30th second can be synchronized by a time stamp, so that the data obtained by the two samples can be connected.
在一个实施例中,若在播放设备播放所述音频数据的过程中检测到暂停操作,停止执行对所述PCM音频数据进行缓存的功能;在检测到播放设备对
所述音频数据的播放进程恢复时,返回对所述PCM音频数据进行缓存的功能。例如,在实际情况下,用户通过蓝牙播放器播放手机中存储的音频文件时,可能会因手机接到来电而导致音乐播放停止。此时,音频文件存储过程也相应停止。在用户结束来电通话,并重新播放音乐时,可恢复音频文件存储过程。在另一个实施例中,在播放设备播放所述音频数据的过程中检测到暂停操作之后,还可以从检测到暂停操作的时刻开始计数;若在计数值达到预设的计数阈值之前,检测到播放设备对所述音频数据的播放进程恢复,返回对所述PCM音频数据进行缓存的功能。通过这种方式,可以避免不完整的音频数据长期占有缓存空间。In one embodiment, if a pause operation is detected during playback of the audio data by the playback device, the function of buffering the PCM audio data is stopped; when the playback device pair is detected
When the playing process of the audio data is restored, a function of buffering the PCM audio data is returned. For example, in actual situations, when a user plays an audio file stored in a mobile phone through a Bluetooth player, music playback may be stopped due to a call received by the mobile phone. At this point, the audio file storage process is stopped accordingly. The audio file storage process can be resumed when the user ends the incoming call and replays the music. In another embodiment, after the pause operation is detected in the process of playing the audio data by the playback device, the counting may also be started from the moment when the pause operation is detected; if the count value reaches the preset count threshold, the detection is detected. The playback device resumes the playing process of the audio data, and returns a function of buffering the PCM audio data. In this way, it is possible to prevent incomplete audio data from occupying the cache space for a long time.
值得一提的是,上述功能以及本发明的以下各个功能可以由蓝牙播放器实现,也可以由其他控制器或处理器等设备来实现。It is worth mentioning that the above functions and the following various functions of the present invention may be implemented by a Bluetooth player or by other controllers or processors.
压缩模块20,用于在对所述音频数据的播放进程到达预设的播放终点时,根据设定的音频文件格式对缓存的PCM音频数据进行压缩;The compression module 20 is configured to compress the buffered PCM audio data according to the set audio file format when the playing process of the audio data reaches a preset playing end point;
在保存音频文件时,可以设置两种模式,一种是自动保存模式,另一种是手动保存模式。在自动保存模式下,只要用户选中的音频数据缓存完毕,即自动进行压缩并存储。上述用户选中的音频数据是指缓存模块10中所述起点和终点之间的音频数据。在手动保存模式下,可以由用户手动选择是否对音频数据进行缓存。具体地,可以接收对所述PCM音频数据的存储指令;响应所述存储指令对缓存的PCM音频数据进行压缩。如果所述蓝牙播放器具有人机交互界面(例如,显示屏),可在显示屏上显示一个对话框,该对话框中可包括选项,例如,包括确定选项和取消选项,如果用户点击确认选项,则对缓存的PCM音频数据进行压缩,如果用户点击取消选项,则不对缓存的PCM音频数据进行压缩,并可将缓存中的PCM音频数据清空,以避免用户不需要的数据长期占有缓存空间。在一个实施例中,弹出对话框后,若一段时间内用户没有选择对话框中的选项,可以退出该对话框,并执行对缓存的PCM音频数据进行压缩的操作。When saving an audio file, you can set two modes, one is the auto save mode and the other is the manual save mode. In the automatic save mode, as long as the audio data selected by the user is cached, it is automatically compressed and stored. The audio data selected by the above user refers to the audio data between the start point and the end point in the cache module 10. In the manual save mode, the user can manually select whether to cache the audio data. Specifically, a store instruction for the PCM audio data may be received; the cached PCM audio data is compressed in response to the store instruction. If the Bluetooth player has a human-computer interaction interface (eg, a display screen), a dialog box may be displayed on the display screen, which may include options, for example, including a determination option and a cancellation option, if the user clicks on the confirmation option, The cached PCM audio data is compressed. If the user clicks the cancel option, the cached PCM audio data is not compressed, and the PCM audio data in the cache can be emptied to avoid long-term occupation of the cache space by the data that the user does not need. In one embodiment, after the dialog box is popped up, if the user does not select an option in the dialog box for a period of time, the dialog box may be exited and the operation of compressing the cached PCM audio data may be performed.
存储模块30,用于将压缩的PCM音频数据存储在播放设备的存储介质上。
The storage module 30 is configured to store the compressed PCM audio data on a storage medium of the playback device.
在一个实施例中,还可以获取所述音频文件的类别信息;将所述类别信息与压缩的PCM音频数据进行关联,得到关联信息;将所述关联信息存储在播放设备的存储介质上。其中,所述类别信息可以包括所述音频文件中的声音的种类(例如,风声、鸟兽声、二胡、钢琴等),或者发声者的姓名(例如,当音频文件是歌曲时,该类别信息可以是歌手的姓名)、音频文件的制作时间、音频文件的格式(例如,mp3格式)、音频文件的名称等。上述类别信息可以由用户手动输入,也可以通过相应的协议从存储音频文件的终端自动传输到音频播放设备。例如,以手机和蓝牙播放器为例,手机和蓝牙播放器可通过蓝牙A2DP协议(Advanced Audio Distribution Profile蓝牙音频传输模型协定)进行通信,通过该协议,蓝牙播放器可以获知当前播放的歌曲的歌手名和歌曲名,在一个实施例中,可以将歌曲的类别信息以"歌手名-歌曲名.mp3"等类似的方式进行保存。In an embodiment, the category information of the audio file may also be acquired; the category information is associated with the compressed PCM audio data to obtain association information; and the association information is stored on a storage medium of the playback device. The category information may include a type of sound in the audio file (eg, wind, bird, erhu, piano, etc.), or a name of the utterer (eg, when the audio file is a song, the category information) It can be the name of the singer, the production time of the audio file, the format of the audio file (for example, mp3 format), the name of the audio file, and the like. The above category information may be manually input by the user, or may be automatically transmitted from the terminal storing the audio file to the audio playback device through a corresponding protocol. For example, in the case of a mobile phone and a Bluetooth player, the mobile phone and the Bluetooth player can communicate via the Bluetooth A2DP protocol (Advanced Audio Distribution Profile), through which the Bluetooth player can learn the singer of the currently playing song. Name and song name, in one embodiment, the category information of the song can be saved in a similar manner as "singer name-song name.mp3" or the like.
上述音频文件存储方法和系统,在播放设备播放音频数据时,同步对音频数据进行采样、缓存,在需要缓存的音频数据播放完成之后,将缓存的音频数据进行压缩存储,能够在播放音频数据的同时在播放终端对音频数据进行同步录制,无需安装特定软件就能对音频文件进行存储,使用范围广,使用灵活性高,且不影响音频文件播放,能够在播放音频文件的同时对音频文件进行存储,效率高。The above audio file storage method and system, when the playing device plays the audio data, synchronously samples and buffers the audio data, and after the audio data to be buffered is played, the buffered audio data is compressed and stored, and the audio data can be played. At the same time, the audio data is synchronously recorded in the playing terminal, and the audio file can be stored without installing specific software, and the use range is wide, the use flexibility is high, and the audio file playing is not affected, and the audio file can be played while playing the audio file. Storage, high efficiency.
本发明的音频文件存储系统与本发明的音频文件存储方法一一对应,在上述音频文件存储方法的实施例阐述的技术特征及其有益效果均适用于音频文件存储系统的实施例中,特此声明。The audio file storage system of the present invention has a one-to-one correspondence with the audio file storage method of the present invention, and the technical features and the beneficial effects thereof described in the embodiments of the audio file storage method are applicable to the embodiment of the audio file storage system, and hereby declare .
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be considered as the scope of this manual.
以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围
应以所附权利要求为准。
The above-described embodiments are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, the scope of protection of the patent of the present invention
The following claims shall prevail.
Claims (10)
- 一种音频文件存储方法,其特征在于,包括以下步骤:An audio file storage method, comprising the steps of:在播放设备播放存储音频文件的终端发送的音频数据时,同步地对所述音频数据进行PCM采样,得到PCM音频数据,对所述PCM音频数据进行缓存;When the playback device plays the audio data sent by the terminal storing the audio file, the audio data is synchronously PCM-sampled to obtain PCM audio data, and the PCM audio data is buffered;在对所述音频数据的播放进程到达预设的播放终点时,根据设定的音频文件格式对缓存的PCM音频数据进行压缩;When the playing process of the audio data reaches a preset playing end point, the buffered PCM audio data is compressed according to the set audio file format;将压缩的PCM音频数据存储在播放设备的存储介质上。The compressed PCM audio data is stored on a storage medium of the playback device.
- 根据权利要求1所述的音频文件存储方法,其特征在于,根据设定的音频文件格式对缓存的PCM音频数据进行压缩的步骤包括:The audio file storage method according to claim 1, wherein the compressing the buffered PCM audio data according to the set audio file format comprises:接收对所述PCM音频数据的存储指令;Receiving a storage instruction for the PCM audio data;响应所述存储指令对缓存的PCM音频数据进行压缩。The buffered PCM audio data is compressed in response to the store instruction.
- 根据权利要求1所述的音频文件存储方法,其特征在于,对所述音频数据进行PCM采样的步骤包括:The audio file storage method according to claim 1, wherein the step of performing PCM sampling on the audio data comprises:将所述音频数据的起始播放进度与预设的采样起点进行比较;Comparing the initial playback progress of the audio data with a preset sampling start point;若所述起始播放进度在所述采样起点之前,在当前播放进度到达所述采样起点时,对所述音频数据进行PCM采样。If the initial play progress is before the sampling start point, the audio data is PCM sampled when the current play progress reaches the sampling start point.
- 根据权利要求1所述的音频文件存储方法,其特征在于,还包括以下步骤:The audio file storage method according to claim 1, further comprising the steps of:若在播放设备播放所述音频数据的过程中检测到快进操作操作,停止对所述PCM音频数据进行缓存的步骤,并将缓存中的PCM音频数据清空。If a fast forward operation is detected during playback of the audio data by the playback device, the step of buffering the PCM audio data is stopped, and the PCM audio data in the buffer is emptied.
- 根据权利要求1所述的音频文件存储方法,其特征在于,还包括以下步骤:The audio file storage method according to claim 1, further comprising the steps of:若在播放设备播放所述音频数据的过程中检测到暂停操作,停止对所述PCM音频数据进行缓存的步骤;If the pause operation is detected during the playback of the audio data by the playback device, the step of buffering the PCM audio data is stopped;在检测到播放设备对所述音频数据的播放进程恢复时,返回对所述PCM音频数据进行缓存的步骤。When it is detected that the playing device resumes the playing process of the audio data, the step of buffering the PCM audio data is returned.
- 根据权利要求5所述的音频文件存储方法,其特征在于,在播放设备 播放所述音频数据的过程中检测到暂停操作之后,还包括以下步骤:The audio file storage method according to claim 5, wherein the playback device is After detecting the pause operation in the process of playing the audio data, the following steps are also included:从检测到暂停操作的时刻开始计数;Counting from the moment the pause operation is detected;若在计数值达到预设的计数阈值之前,检测到播放设备对所述音频数据的播放进程恢复,返回对所述PCM音频数据进行缓存的步骤。If it is detected that the playback process of the audio data is resumed by the playback device before the count value reaches the preset count threshold, the step of buffering the PCM audio data is returned.
- 根据权利要求1至6任意一项所述的音频文件存储方法,其特征在于,还包括以下步骤:The audio file storage method according to any one of claims 1 to 6, further comprising the steps of:获取所述音频文件的类别信息;Obtaining category information of the audio file;将所述类别信息与压缩的PCM音频数据进行关联,得到关联信息;Associating the category information with the compressed PCM audio data to obtain associated information;将所述关联信息存储在播放设备的存储介质上。The associated information is stored on a storage medium of the playback device.
- 根据权利要求7所述的音频文件存储方法,其特征在于,所述播放设备为蓝牙播放器,所述蓝牙播放器与所述终端通过蓝牙方式相连接。The audio file storage method according to claim 7, wherein the playback device is a Bluetooth player, and the Bluetooth player is connected to the terminal via a Bluetooth mode.
- 根据权利要求8所述的音频文件存储方法,其特征在于,通过蓝牙A2DP协议获取所述音频文件的类别信息。The audio file storage method according to claim 8, wherein the category information of the audio file is acquired through a Bluetooth A2DP protocol.
- 一种音频文件存储系统,其特征在于,包括:An audio file storage system, comprising:缓存模块,用于在播放设备播放存储音频文件的终端发送的音频数据时,同步地对所述音频数据进行PCM采样,得到PCM音频数据,对所述PCM音频数据进行缓存;a cache module, configured to: when the playing device plays the audio data sent by the terminal storing the audio file, perform PCM sampling on the audio data to obtain PCM audio data, and cache the PCM audio data;压缩模块,用于在对所述音频数据的播放进程到达预设的播放终点时,根据设定的音频文件格式对缓存的PCM音频数据进行压缩;a compression module, configured to compress the buffered PCM audio data according to the set audio file format when the playing process of the audio data reaches a preset playing end point;存储模块,用于将压缩的PCM音频数据存储在播放设备的存储介质上。 And a storage module, configured to store the compressed PCM audio data on a storage medium of the playback device.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611116023.4 | 2016-12-07 | ||
CN201611116023.4A CN106803426A (en) | 2016-12-07 | 2016-12-07 | audio file storage method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018103420A1 true WO2018103420A1 (en) | 2018-06-14 |
Family
ID=58984568
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/103458 WO2018103420A1 (en) | 2016-12-07 | 2017-09-26 | Method and system for storing audio file |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106803426A (en) |
WO (1) | WO2018103420A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113556292A (en) * | 2021-06-18 | 2021-10-26 | 珠海惠威科技有限公司 | Audio playing method and system of IP network |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106803426A (en) * | 2016-12-07 | 2017-06-06 | 广州视源电子科技股份有限公司 | audio file storage method and system |
CN115022442B (en) * | 2021-12-16 | 2023-06-09 | 荣耀终端有限公司 | Audio fault time positioning method, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101841681A (en) * | 2009-03-21 | 2010-09-22 | 中兴通讯股份有限公司 | Method and device for recording mobile multimedia broadcast program |
CN202145381U (en) * | 2011-06-16 | 2012-02-15 | 无锡硅动力微电子股份有限公司 | Record and playback device used in vehicle-mounted sound and miniature player |
CN105307102A (en) * | 2014-07-18 | 2016-02-03 | 光宝电子(广州)有限公司 | Bluetooth wireless audio transmitter |
CN105895132A (en) * | 2016-03-18 | 2016-08-24 | 北京智驾互联信息服务有限公司 | Vehicle-mounted voice recording method, apparatus and system |
CN106156036A (en) * | 2015-03-26 | 2016-11-23 | 腾讯科技(深圳)有限公司 | A kind of onboard audio processing method and mobile unit |
CN106803426A (en) * | 2016-12-07 | 2017-06-06 | 广州视源电子科技股份有限公司 | audio file storage method and system |
-
2016
- 2016-12-07 CN CN201611116023.4A patent/CN106803426A/en active Pending
-
2017
- 2017-09-26 WO PCT/CN2017/103458 patent/WO2018103420A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101841681A (en) * | 2009-03-21 | 2010-09-22 | 中兴通讯股份有限公司 | Method and device for recording mobile multimedia broadcast program |
CN202145381U (en) * | 2011-06-16 | 2012-02-15 | 无锡硅动力微电子股份有限公司 | Record and playback device used in vehicle-mounted sound and miniature player |
CN105307102A (en) * | 2014-07-18 | 2016-02-03 | 光宝电子(广州)有限公司 | Bluetooth wireless audio transmitter |
CN106156036A (en) * | 2015-03-26 | 2016-11-23 | 腾讯科技(深圳)有限公司 | A kind of onboard audio processing method and mobile unit |
CN105895132A (en) * | 2016-03-18 | 2016-08-24 | 北京智驾互联信息服务有限公司 | Vehicle-mounted voice recording method, apparatus and system |
CN106803426A (en) * | 2016-12-07 | 2017-06-06 | 广州视源电子科技股份有限公司 | audio file storage method and system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113556292A (en) * | 2021-06-18 | 2021-10-26 | 珠海惠威科技有限公司 | Audio playing method and system of IP network |
Also Published As
Publication number | Publication date |
---|---|
CN106803426A (en) | 2017-06-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11979836B2 (en) | Method and system for operating a multi-function portable electronic device using voice-activation | |
US12067332B2 (en) | Information processing device, information processing method, information processing program, and terminal device | |
CN101416510B (en) | Method and system for managing audio data | |
JP2019117623A (en) | Voice dialogue method, apparatus, device and storage medium | |
US9978384B2 (en) | Audio decoding using modulator-demodulator | |
US10283168B2 (en) | Audio file re-recording method, device and storage medium | |
US20080250066A1 (en) | Apparatus and method for adding contact information into a contact list | |
WO2018103420A1 (en) | Method and system for storing audio file | |
US20160320755A1 (en) | Wireless music system and method for setting alarm clock of wireless music system | |
WO2018152679A1 (en) | Audio file transmitting method and apparatus, audio file receiving method and apparatus, devices and system | |
CN106887244B (en) | Audio switching method and device | |
GB2452597A (en) | Synchronizing Digital Audio and Analog Video from aPortable Media Device | |
US9384752B2 (en) | Audio device and storage medium | |
TW201520896A (en) | A method for operating a program and a device thereof | |
WO2017166607A1 (en) | Earphone-based sound recording control method and apparatus, electronic device, and storage medium | |
CN113726600B (en) | Transmission delay determining method, device, terminal and storage medium | |
TWI630543B (en) | An electronic device and method for replaying voice | |
JP6051075B2 (en) | A communication karaoke system that can continue duet singing in the event of a communication failure | |
EP1551024A2 (en) | File access method for a storage medium in a wireless terminal | |
CN101242440A (en) | A mobile phone with voice repeating function | |
US11120810B2 (en) | Recording device | |
KR100703299B1 (en) | Apparatus and method for controlling ring tone in mobile terminal having a hard disc drive | |
CN201044492Y (en) | Mobile phone with sound repeating function | |
CN100372408C (en) | Handset providing function of recording and playing back sound | |
CN115730093A (en) | Multimedia recommendation method and device and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17878197 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 16.10.2019) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17878197 Country of ref document: EP Kind code of ref document: A1 |