我正在使用Bass播放器播放音频。
我如何使用它
首先,我下载清单文件以获取分段音频文件的列表。在看到的Bass背后,下载音频文件。 当我寻找内容时,我想重用现有的流。一些它是如何第一次工作,然后在它不工作之后。
-- Load Agg data for the YYYYMM to Teradta
SELECT SUM(loaded_row_count),SUM(error_row_count)
FROM load_to_teradata (
ON ( select
Cust_id
, cast(lst_cnf_actvy_dt_tm as date) as lst_cnf_actvy_dt
, cast(sum(str_cnt ) as INTEGER) as acct_open_brnch_use_cnt
, cast(sum(phone_cnt ) as INTEGER) as acct_open_phn_use_cnt
, cast(sum(mail_cnt ) as INTEGER) as acct_open_mail_use_cnt
, cast(sum(onlnchnl_cnt) as INTEGER) as acct_open_onln_use_cnt
, cast(sum(mblbnk_cnt ) as INTEGER) as acct_open_mbl_dvc_use_cnt
, cast(sum(acctopen_cnt) as INTEGER) as acct_open_trck_chnl_cnt
from <someDB>.<someTBL>
where acctopen_cnt > 0
and lower(lst_cnf_actvy_typ_cd) = 'acctopen'
and cast(lst_cnf_actvy_dt_tm as date) between
cast(substring('${YYYYMM}' from 1 for 4) || '-' || substring('${YYYYMM}' from 5 for 2) || '-01' as date) and
cast((cast(substring('${YYYYMM}' from 1 for 4) || '-' || substring('${YYYYMM}' from 5 for 2) || '-01' as date) + interval '1 month') - interval '1 day' as date)
and (str_cnt > 0 or phone_cnt > 0 or mail_cnt > 0 or onlnchnl_cnt > 0 or mblbnk_cnt > 0)
group by 1,2 )
TDPID('TD_RDBMS_C2T') USERNAME('${c2tUID}') PASSWORD('${c2tPWD}') ${LDAP_IND_AST_C2T}
TARGET_TABLE ( 'C2T.t_yyyymm_agg' ) LOG_TABLE ('C2T.t_yyyymm_aggLOG')
MAX_SESSIONS(120));
获取位置的功能
while (!finishSeeking)
{
TimeSpan? currentStreamPosition = Wrapper.GetStreamPosition(streamId);
if (!currentStreamPosition.HasValue)
{
seekFailed = true;
break;
}
if (currentStreamPosition >= seekPosition)
{
// reached the position we wanted
break;
}
if (previousStreamPosition < currentStreamPosition)
{
lastAdvanceTime = DateTime.Now;
previousStreamPosition = currentStreamPosition.Value;
}
long seekPositionBytes = Wrapper.ConvertOffsetToNumberOfBytes(streamId, seekPosition);
if (!Wrapper.SeekToPositionInBytes(streamId, seekPositionBytes))
{
seekFailed = true;
break;
}
if (lastAdvanceTime - DateTime.Now >= SEEK_TIMEOUT)
{
seekFailed = true;
break;
}
}
以及一些常见的低音API
public static TimeSpan? GetStreamPosition(int streamId)
{
long bytesOffset = GetStreamPositionInBytes(streamId);
var secondsOffset = Bass.BASS_ChannelBytes2Seconds(streamId, bytesOffset);
if (secondsOffset < 0)
{
return null;
}
return TimeSpan.FromSeconds(secondsOffset);
}
我用来寻找内容。 首次寻求
Bass.BASS_ChannelSeconds2Bytes(streamId, offset.TotalSeconds);
从不给我更多的时间,而是给我更多的时间,有时它会在9秒内停留在13秒上。 因此,我的循环永不中断。