


export function PlayAudio() {
  // @ts-ignore
  const app = typeof getApp == 'function' && getApp()
  const audioIns = app?.audioContext
  if (audioIns) {
    audioIns.onPlay(() => {
      console.log('播放')
    })
    audioIns.onError(() => {
      console.log('audio error')
    })
  }
  audioIns && audioIns.play()
}

export const getTbSpi = (function() {
  let spiSrc = ''
  return function() {
    if (spiSrc) return spiSrc
    // @ts-ignore
    const app = typeof getApp == 'function' && getApp()
    if (app) {
      return spiSrc = app.rabbitSpiUrl
    } else {
      throw new Error('no app !!!!!')
    }
  }
})()