QCC30xx 51xx 如何获取当前听音乐时间

本文介绍了如何在基于QCC30xx和51xx的设备上获取当前听音乐的时间。通过设置和重置播放时间变量,并结合A2DP状态和系统时钟来计算已播放的秒数,实现了听音乐时间的获取功能。
摘要由CSDN通过智能技术生成
QCC30xx 51xx 如何获取当前听音乐时间

/*!
@file
@ingroup sink_app
@brief   a2dp initialisation and control functions
*/
 
#include "sink_private_data.h"
#include "sink_main_task.h"
#include "sink_statemanager.h"
#include "sink_states.h"
#include "sink_a2dp.h"
#include "sink_a2dp_capabilities.h"
#include "sink_a2dp_aptx_adaptive.h"
#include "sink_devicemanager.h"
#include "sink_link_policy.h"
#include "sink_audio.h"
#include "sink_usb.h"
#include "sink_wired.h"
#include "sink_scan.h"
#include "sink_audio_routing.h"
#include "sink_slc.h"
#include "sink_device_id.h"
#include "sink_partymode.h"
#include "sink_config.h"
#include "sink_auth.h"
#include "sink_peer.h"
#include "sink_avrcp.h"
#include "sink_peer_qualification.h"
#include "sink_linkloss.h"
#include "sink_callmanager.h"
#include "sink_volume.h"
 
#include "sink_gaia.h"
 
#ifdef ENABLE_SUBWOOFER
#include "sink_swat.h"
#endif
#include "sink_hfp_data.h"
#include "sink_music_processing.h"
#include "sink_auto_power_off.h"
 
#ifdef ENABLE_AVRCP
#include "sink_tones.h"
#endif
 
#include "sink_ba.h"
#include "sink_powermanager.h"
 
#include <util.h>
#include <bdaddr.h>
#include <a2dp.h>
#include <connection.h>
#include <hfp.h>
#include <stdlib.h>
#include <panic.h>
#include <ps.h>
#include <message.h>
#include <audio_plugin_music_variants.h>
#include <audio_music_processing.h>
#include <audio_config.h>
#include <config_store.h>
#include <gain_utils.h>
#include <audio.h>
 
#include "sink_slc.h"
#include "sink_upgrade.h"
 
#include "config_definition.h"
#include "sink_a2dp_config_def.h"
#include "sink_malloc_debug.h"
 
#ifdef SBC_ENCODER_CONFORMANCE
#include "sink_sbc.h"
#endif
 
#ifdef DEBUG_A2DP
#define A2DP_DEBUG(x) DEBUG(x)
#ifdef ENABLE_PEER
static const char * const rdname[] = { "Unknown", "Non-Peer", "Peer" };
#endif
#else
#define A2DP_DEBUG(x)
#endif
 
/* Helper macro for converting a bypass bit flag into a boolean type. */
#define MusicEnhancementBypassed(enhancements, bypass_flag) (((enhancements) & (bypass_flag)) == (bypass_flag))
 
#ifdef ENABLE_PEER
#define SBC_SAMPLING_FREQ_16000        128
#define SBC_SAMPLING_FREQ_32000         64
#define SBC_SAMPLING_FREQ_44100         32
#define SBC_SAMPLING_FREQ_48000         16
#define SBC_CHANNEL_MODE_MONO            8
#define SBC_CHANNEL_MODE_DUAL_CHAN       4
#define SBC_CHANNEL_MODE_STEREO          2
#define SBC_CHANNEL_MODE_JOINT_STEREO    1
 
#define SBC_BLOCK_LENGTH_4             128
#define SBC_BLOCK_LENGTH_8              64
#define SBC_BLOCK_LENGTH_12             32
#define SBC_BLOCK_LENGTH_16             16
#define SBC_SUBBANDS_4                   8
#define SBC_SUBBANDS_8                   4
#define SBC_ALLOCATION_SNR               2
#define SBC_ALLOCATION_LOUDNESS          1
 
/* True Wireless Stereo Codec ID configured using either SBC, MP3, AAC or APTX type capabilities.
  * As a default configuration refer tws_sbc_caps for mandate SBC type media codec service category fixed offset value */
#define MEDIA_TRANSPORT_SERVICE_CATEGORY_OFFSET     2
#define CONFIGURED_MEDIA_CODEC_OFFSET     12
 
/* Codec caps to use for a TWS Source SEP when 16KHz SBC is required */
const uint8 sbc_caps_16k[8] =
{
 
    AVDTP_SERVICE_MEDIA_CODEC,
    6,
    AVDTP_MEDIA_TYPE_AUDIO<
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值