CN107993679A - A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset - Google Patents

A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset Download PDF

Info

Publication number
CN107993679A
CN107993679A CN201711066668.6A CN201711066668A CN107993679A CN 107993679 A CN107993679 A CN 107993679A CN 201711066668 A CN201711066668 A CN 201711066668A CN 107993679 A CN107993679 A CN 107993679A
Authority
CN
China
Prior art keywords
buffer
mcu
song
data
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711066668.6A
Other languages
Chinese (zh)
Inventor
戴文穗
陈洪太
胡中骥
严文华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GUANGZHOU I-SPK ELECTRONIC TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU I-SPK ELECTRONIC TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GUANGZHOU I-SPK ELECTRONIC TECHNOLOGY Co Ltd filed Critical GUANGZHOU I-SPK ELECTRONIC TECHNOLOGY Co Ltd
Priority to CN201711066668.6A priority Critical patent/CN107993679A/en
Publication of CN107993679A publication Critical patent/CN107993679A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/10537Audio or video recording
    • G11B2020/10546Audio or video recording specifically adapted for audio data
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/1062Data buffering arrangements, e.g. recording or playback buffers
    • G11B2020/10675Data buffering arrangements, e.g. recording or playback buffers aspects of buffer control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset, the playback method includes:The MCU of bluetooth headset reads the listing file A built on inside MCU and whether contrast current SD card song information consistent, if inconsistent, updates listing file A;Song information in MCU read list files A, loads song information in buffer;MCU loads the information of current song, reads the data of song files;Start buffer, read the data of song, be saved in buffer;The on a frame-by-frame basis data in play-out buffer internal buffer, finish playing a frame, play next frame and produce callback signal, the data that buffer reads song are saved in buffer to keep at least two frame data in buffering area until current song finishes, its cost is low, the fluency that is efficient and ensure that playback of songs of system operation.

Description

A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset
Technical field
The present invention relates to electronic equipment, more particularly to a kind of buffer-type MP3 music players of embedded bluetooth headset are broadcast Put method.
Background technology
Gradually occur on product of the bluetooth headset with the offline players of MP3 currently on the market, but due to MP3 decoding Journey is excessively complicated, can consume bluetooth headset MCU substantial amounts of processing times, so most of product can all select third party to develop Module is realized, but a shortcoming substantially occurs among these, is exactly additionally to have added more a MCU, can so be increased product Power consumption and cost.Further, since the disposal ability of bluetooth headset MCU is limited, such as directly transplanting MP3 decoding device to bluetooth headset If MCU realizes the whole function of broadcasting, bluetooth headset MCU, which works together, also seems very painstaking.
The content of the invention
It is a primary object of the present invention to overcome the shortcomings of above-mentioned background technology, there is provided a kind of buffering of embedded bluetooth headset The playback method of formula MP3 music players, its cost is low, the fluency that is efficient and ensure that playback of songs of system operation.
Above-mentioned purpose is achieved by the following technical solution:
The playback method of the buffer-type MP3 music players of a kind of embedded bluetooth headset, in the MCU firmwares of bluetooth headset The MP3 decoding device that transplanting has a module of FAT32 file system and third party increases income, the playback method include:
The MCU of bluetooth headset read the listing file A built on inside MCU and contrast current SD card song information whether one Cause, if inconsistent, update listing file A;
Song information in MCU read list files A, loads song information in buffer;
MCU loads the information of current song, reads the data of song files;
Start buffer, read the data of song, be saved in buffer;
The on a frame-by-frame basis data in play-out buffer internal buffer, finish playing a frame, plays next frame and produces back Signal is adjusted, the data that buffer reads song are saved in buffer to keep at least two frame data in buffering area until current song Song finishes.
In some embodiments, when SD card being inserted into MCU first, MCU creates listing file A and by all MP3 type The path and name of file recorded in listing file A.
In some embodiments, when the information of MCU loading current songs, after reading the data of song files, MCU judges Whether buffering area A is idle to a certain extent, if so, starting buffer, reads the data of song, is saved in buffer;If it is not, MCU judges whether buffer is starting, if so, starting buffer, reads the data of song, is saved in buffer.
In some embodiments, start buffer, read the data of song, after being saved in buffer, MCU judges buffering It is a degree of whether area A is filled into, if so, closing buffer.
In some embodiments, if it in startup or buffering area A is not to be filled into certain journey that MCU, which judges that buffer is not, Degree, MCU reads a frame data of buffering area A, judges whether data are empty, if so, setting flag bit;An if it is not, frame data Decoded.
In some embodiments, after a frame data are decoded, MCU judges whether buffering area B has two frame data, if It is no, repeat MCU judge buffering area A whether free time to a certain extent the step of;If so, the frame that finishes playing, plays next frame simultaneously Produce callback signal.
In some embodiments, after setting flag bit or producing callback signal, MCU judges whether data have read, If so, song switching is carried out according to listing file A;If it is not, repeat MCU judge buffering area A whether free time step to a certain extent Suddenly.
Compared with prior art, the present invention at least have the effect that:
1st, the playback method of the buffer-type MP3 music players of a kind of embedded bluetooth headset of the invention, third party is opened The MP3 decoding device in source is transplanted in bluetooth headset MCU firmwares, passes through the optimization of MP3 decoding device, the change (generation of MCU operational modes Code is transferred on ram from flash), command operating cycle is reduced, so as to form the effect of acceleration.By the data in SD card, use Data, are transferred in the RAM of MCU by the mode of buffering in advance, improve the efficiency of system operation.Music player employs half Half mode played is preserved, ensure that the fluency of playback of songs.
Brief description of the drawings
Fig. 1 is the flow diagram of playback method in embodiment.
Embodiment
The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
Embodiment one:As shown in Figure 1, the present embodiment is a kind of buffer-type MP3 music players of embedded bluetooth headset Playback method, the MP3 that transplanting has a module of FAT32 file system in the MCU firmwares of bluetooth headset and third party increases income Decoder, the playback method include:
The MCU of bluetooth headset read the listing file A built on inside MCU and contrast current SD card song information whether one Cause, if inconsistent, update listing file A;
Song information in MCU read list files A, loads song information in buffer buffer;
MCU loads the information of current song, reads the data of song files;
Start buffer, read the data of song, be saved in buffer;
The on a frame-by-frame basis data in play-out buffer internal buffer, finish playing a frame, plays next frame and produces back Signal is adjusted, the data that buffer reads song are saved in buffer to keep at least two frame data in buffering area until current song Song finishes.
A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset of the present embodiment, third party is opened The MP3 decoding device in source is transplanted in bluetooth headset MCU firmwares, passes through the optimization of MP3 decoding device, the change (generation of MCU operational modes Code is transferred on ram from flash), command operating cycle is reduced, so as to form the effect of acceleration.By the data in SD card, use Data, are transferred in the SRAM of MCU by the mode of buffering in advance, improve the efficiency of system operation.Music player employs Half preserves half mode played, ensure that the fluency of playback of songs.
In addition, the insertion of FAT32 file system so that bluetooth MCU can read file all in SD and new files.
In addition, the third-party decoding storehouse of the Scheme Choice of MP3 decoding, since third-party decoding storehouse is suitable for high-performance Processor, but the performance of this bluetooth MCU can be tackled reluctantly, so needing to carry out part optimization to decoding storehouse source code and repairing Change.Source code is largely that c language is write, it is only necessary to the code equivalence of c language is changed into assembler language, it is possible to reach one Surely the result optimized.The code module of MP3 relative decodings, Code transformations are run relevant on RAM on RAM in flash Code module, reduces the command operating cycle of processor, so that speed can be multiplied several times, preferably optimizes power consumption.
Further, when SD card being inserted into MCU first, MCU creates listing file A and by the road of all MP3 type files Footpath and name record are in listing file A.When starting MCU next time, all the elements in the first active read list file A of meeting, So as to obtain the message of song, then contrasted, if changed, be updated listing file A, otherwise without any behaviour Make.By the record content of listing file A, the state of player can be recovered rapidly.
Further, when the information of MCU loading current songs, after reading the data of song files, MCU judges buffering area A Whether it is idle to a certain extent, if so, starting buffer, read the data of song, be saved in buffer;If it is not, MCU judges Whether buffer is starting, if so, starting buffer, reads the data of song, is saved in buffer.
Further, start buffer, read the data of song, after being saved in buffer, whether MCU judges buffering area A Be filled into it is a degree of, if so, close buffer.
Further, if it in startup or buffering area A is not to be filled into a degree of, MCU that MCU, which judges that buffer is not, A frame data of buffering area A are read, judge whether data are empty, if so, setting flag bit;If it is not, a frame data are decoded.
Further, after a frame data are decoded, MCU judges whether buffering area B has two frame data, if it is not, repeating MCU Judge buffering area A it is whether idle to a certain extent the step of;If so, the frame that finishes playing, plays next frame and produces readjustment letter Number.
Further, after setting flag bit or producing callback signal, MCU judges whether data have read, if so, according to The listing file A carries out song switching in buffer buffer;If it is not, repeating MCU judges whether buffering area A is idle to certain The step of degree.
MP3 decoding is all on a frame-by-frame basis decoded, and music player in this design, and does not have real-time, passes through The buffer of song is buffered, postpones the reproduction time of a frame, ensure that the fluency of player.Broadcast mode is played using a frame One frame buffering (half preserve half play), keeps buffering area to have the size of data of two frames, when a frame finishes playing, will produce one The signal of a readjustment, after receiving this signal, bluetooth MCU can carry out the decoding of next frame, be filled into automatically after the completion of decoding slow Rush area.
MP3 player all on a frame-by-frame basis plays, since MCU is to be communicated by SDIO with exterior SD card, every time Read the data volume of a frame and little, cause to communicate that number is excessively frequent, MCU power consumptions and take MCU resource it is unreasonable. This, just introduces a kind of new processing mode, is exactly to increase the data volume for reading file every time, without used data buffering Get up, once buffering area filling is to a certain degree, just stops buffering and read file data, MP3 decoding device extraction data are direct From buffering area extraction can, when extract certain degree will retriggered buffer, be again started up data buffering Mode.In this manner, greatly reduce the number that MCU is communicated with exterior SD card, so as to play the role of optimizing MCU power consumptions.
In addition, the present embodiment provides a kind of bluetooth MP3 sports earphones, by the MCU that MP3 player is embedded in bluetooth headset Firmware, extends out MP3 modules to reduce, reduces cost, optimize power consumption.
Finally, the present embodiment also provides a kind of bluetooth MP3 laser earphones, by the way that MP3 player is embedded in bluetooth headset MCU firmwares, extend out MP3 modules to reduce, reduce cost, optimize power consumption.
Above-described is only some embodiments of the present invention.For those of ordinary skill in the art, not On the premise of departing from the invention design, various modifications and improvements can be made, these belong to the protection model of the present invention Enclose.

Claims (7)

1. the playback method of the buffer-type MP3 music players of a kind of embedded bluetooth headset, it is characterised in that in bluetooth headset The MP3 decoding device that transplanting has a module of FAT32 file system in MCU firmwares and third party increases income, the playback method include:
The MCU of bluetooth headset reads the listing file A built on inside MCU and whether contrast current SD card song information consistent, If inconsistent, listing file A is updated;
Song information in MCU read list files A, loads song information in buffer;
MCU loads the information of current song, reads the data of song files;
Start buffer, read the data of song, be saved in buffer;
The on a frame-by-frame basis data in play-out buffer internal buffer, finish playing a frame, plays next frame and produces readjustment letter Number, the data that buffer reads song are saved in buffer to keep at least two frame data in buffering area until current song is broadcast Discharge complete.
2. a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset according to claim 1, it is special Sign is, when SD card being inserted into MCU first, MCU creates listing file A and remembers the path and name of all MP3 type files Record in listing file A.
3. a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset according to claim 1 or 2, It is characterized in that, when the information of MCU loading current songs, after reading the data of song files, MCU judges whether buffering area A is empty It is not busy to a certain extent, if so, starting buffer, read the data of song, be saved in buffer;If it is not, MCU judges buffer Whether starting, if so, starting buffer, reading the data of song, be saved in buffer.
4. a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset according to claim 3, it is special Sign is, starts buffer, reads the data of song, after being saved in buffer, MCU judges whether buffering area A is filled into necessarily Degree, if so, closing buffer.
5. a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset according to claim 4, it is special Sign is, if it in startup or buffering area A is not to be filled into a degree of that MCU, which judges that buffer is not, MCU reads buffering area A frame data of A, judge whether data are empty, if so, setting flag bit;If it is not, a frame data are decoded.
6. a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset according to claim 5, it is special Sign is, after a frame data are decoded, MCU judges whether buffering area B has two frame data, if it is not, repeating MCU judges buffering area A it is whether idle to a certain extent the step of;If so, the frame that finishes playing, plays next frame and produces callback signal.
7. a kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset according to claim 6, it is special Sign is that after setting flag bit or producing callback signal, MCU judges whether data have read, if so, according to listing file A Carry out song switching;If it is not, repeat MCU judge buffering area A whether free time to a certain extent the step of.
CN201711066668.6A 2017-11-02 2017-11-02 A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset Pending CN107993679A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711066668.6A CN107993679A (en) 2017-11-02 2017-11-02 A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711066668.6A CN107993679A (en) 2017-11-02 2017-11-02 A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset

Publications (1)

Publication Number Publication Date
CN107993679A true CN107993679A (en) 2018-05-04

Family

ID=62031288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711066668.6A Pending CN107993679A (en) 2017-11-02 2017-11-02 A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset

Country Status (1)

Country Link
CN (1) CN107993679A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104183250A (en) * 2014-08-26 2014-12-03 惠州Tcl移动通信有限公司 Method and system for synchronizing function of music player of intelligent device and Bluetooth headset
CN104240739A (en) * 2014-09-04 2014-12-24 广东欧珀移动通信有限公司 Music playing method and device for mobile terminal
CN105429984A (en) * 2015-11-27 2016-03-23 刘军 Media play method, equipment and music teaching system
US20160132287A1 (en) * 2014-11-12 2016-05-12 Microsoft Technology Licensing, Llc Dynamic Reconfiguration of Audio Devices
US20170185374A1 (en) * 2004-06-25 2017-06-29 Apple Inc. Using a plurality of buffers to provide audio for synchronized playback to multiple audio devices having separate device clocks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170185374A1 (en) * 2004-06-25 2017-06-29 Apple Inc. Using a plurality of buffers to provide audio for synchronized playback to multiple audio devices having separate device clocks
CN104183250A (en) * 2014-08-26 2014-12-03 惠州Tcl移动通信有限公司 Method and system for synchronizing function of music player of intelligent device and Bluetooth headset
CN104240739A (en) * 2014-09-04 2014-12-24 广东欧珀移动通信有限公司 Music playing method and device for mobile terminal
US20160132287A1 (en) * 2014-11-12 2016-05-12 Microsoft Technology Licensing, Llc Dynamic Reconfiguration of Audio Devices
CN105429984A (en) * 2015-11-27 2016-03-23 刘军 Media play method, equipment and music teaching system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109151194A (en) * 2018-08-14 2019-01-04 Oppo广东移动通信有限公司 Data transmission method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN1643605B (en) Data recording method, data recording device, data recording medium, data reproduction method, and data reproduction device
RU2012111352A (en) PLAYBACK SYNCHRONIZATION METHOD AND DEVICE USING THIS METHOD
CN101510313A (en) Method, system and medium player for generating GIF
WO2002082810A1 (en) Video reproduction apparatus for digital video content, video reproduction method, video reproduction program, and package medium
CN102543119A (en) Scene-based music playing processing method and music playing device
EP1145744A3 (en) Game system and computer readable storage medium therefor
CN102857833B (en) Audio decoding system and method adapted to android stagefright multimedia framework
CN101695123A (en) Media broadcasting system and method for respectively customizing broadcast strategy for media segment
CN107993679A (en) A kind of playback method of the buffer-type MP3 music players of embedded bluetooth headset
CN106339210B (en) Data processing method and relevant apparatus in a kind of web game
CN109511008A (en) A method of it is stored based on object and supports that video and audio file content is additional
CN103713926A (en) Method and system for updating software of client in advance
CN105957542B (en) A kind of audio file editing method and device
CN101729848A (en) Game function implement method based on set top box
RU2004139098A (en) MULTIMEDIA PLAYBACK SYSTEM IN PORTABLE DEVICE
CN101646023B (en) Method and system for converting video file into SWF file
CN103531224B (en) Be applied to the simple and easy speech playing method of embedded system platform
CN101345531B (en) Data processing method for ogg format stream
US20150309998A1 (en) Method and apparatus for playing a mp4 file container while generating such a file
CN102122300A (en) Method for converting video format
CN101515274A (en) Method for reading and playing mobile phone audio-frequency data
CN101582284B (en) System and method for editing multimedia displaying schedule for digital photo frame
CN101867888A (en) Method and system for sending multimedia message
CN105049881A (en) Method and system for fast forward and fast backward play based on streaming media server
CN201838322U (en) DVD (digital video disk) playing system with voice reading function for electronic books

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180504

WD01 Invention patent application deemed withdrawn after publication