百度智能小程序API文档(202003)
首页 白天 夜间 BookChat 小程序 小程序 下载 阅读记录
  • 书签 我的书签
  • 添加书签 添加书签 移除书签 移除书签

InnerAudioContext

浏览 4 扫码 打印 2026-09-15 08:44:03
  • swan.createInnerAudioContext
    • 方法参数
      • 返回值
    • 示例
      • 扫码体验
      • 图片示例
      • 代码示例
    • 错误码
      • Android
      • iOS

    swan.createInnerAudioContext

    API 实现差异。 解释: 创建并返回内部 audio 上下文 innerAudioContext 对象。

    方法参数

    无

    返回值

    InnerAudioContext

    示例

    在开发者工具中预览效果

    扫码体验

    请使用百度APP扫码

    图片示例

    代码示例

    -

    1. Page({ onLoad() { const innerAudioContext = swan.createInnerAudioContext(); }});

    错误码

    Android

    iOS

    上一篇:
    下一篇:
    • 书签
    • 添加书签 移除书签
    • API列表
    • 空白文档
    • 基础
      • 应用级事件
        • swan.onPageNotFound
        • swan.onError
        • swan.onAppShow
        • swan.onAppHide
        • swan.offPageNotFound
        • swan.offError
        • swan.offAppShow
        • swan.offAppHide
      • URL Query
        • onURLQueryChange
        • swan.getURLQuery
        • swan.setURLQuery
    • 网络
      • 使用注意事项
      • 请求
        • swan.request
        • RequestTask
          • RequestTask.abort
      • 上传、下载
        • swan.uploadFile
        • UploadTask
          • UploadTask.onProgressUpdate
          • UploadTask.abort
        • swan.downloadFile
        • DownloadTask
          • DownloadTask.onProgressUpdate
          • DownloadTask.abort
      • WebSocket
        • swan.connectSocket
        • swan.onSocketOpen
        • swan.onSocketError
        • swan.sendSocketMessage
        • swan.onSocketMessage
        • swan.closeSocket
        • swan.onSocketClose
        • SocketTask
          • SocketTask.send
          • SocketTask.close
          • SocketTask.onOpen
          • SocketTask.onClose
          • SocketTask.onError
          • SocketTask.onMessage
    • AI
      • 接入说明
      • 文字识别
        • swan.ai.ocrIdCard
        • swan.ai.ocrBankCard
        • swan.ai.ocrDrivingLicense
        • swan.ai.ocrVehicleLicense
      • 文本审核 swan.ai.textReview
      • 语音合成 swan.ai.textToAudio
      • 图像审核 swan.ai.imageAudit
      • 图像识别
        • swan.ai.advancedGeneralIdentify
        • swan.ai.objectDetectIdentify
        • swan.ai.carClassify
        • swan.ai.dishClassify
        • swan.ai.logoClassify
        • swan.ai.animalClassify
        • swan.ai.plantClassify
      • 语音识别
        • swan.ai.getVoiceRecognizer
        • VoiceRecognizer
          • VoiceRecognizer.start
          • VoiceRecognizer.stop
          • VoiceRecognizer.cancel
          • VoiceRecognizer.onStart
          • VoiceRecognizer.onRecognize
          • VoiceRecognizer.onFinish
          • VoiceRecognizer.onError
      • 人脸识别
        • swan.ai.faceDetect
        • swan.ai.faceMatch
        • swan.ai.faceSearch
        • swan.ai.facePersonVerify
        • swan.ai.facePersonIdmatch
        • swan.ai.faceLivenessSessioncode
      • 词法分析 swan.ai.nlpLexerCustom
    • swan.chooseImage
    • swan.previewImage
    • swan.getImageInfo
    • swan.compressImage
    • swan.saveImageToPhotosAlbum
    • swan.chooseAlbum
    • 录音管理
      • swan.getRecorderManager
      • RecorderManager
        • RecorderManager.start
        • RecorderManager.pause
        • RecorderManager.resume
        • RecorderManager.stop
        • RecorderManager.onStart
        • RecorderManager.onPause
        • RecorderManager.onStop
        • RecorderManager.onError
        • RecorderManager.onResume
        • RecorderManager.onInterruptionBegin
        • RecorderManager.onInterruptionEnd
      • swan.getAvailableAudioSources
    • swan.getBackgroundAudioManager
    • BackgroundAudioManager
      • BackgroundAudioManager.play
      • BackgroundAudioManager.pause
      • BackgroundAudioManager.stop
      • BackgroundAudioManager.seek
      • BackgroundAudioManager.onCanplay
      • BackgroundAudioManager.onPlay
      • BackgroundAudioManager.onPause
      • BackgroundAudioManager.onStop
      • BackgroundAudioManager.onEnded
      • BackgroundAudioManager.onTimeUpdate
      • BackgroundAudioManager.onError
      • BackgroundAudioManager.onWaiting
      • BackgroundAudioManager.onSeeked
      • BackgroundAudioManager.onSeeking
      • BackgroundAudioManager.onNext
      • BackgroundAudioManager.onPrev
    • swan.createInnerAudioContext
    • InnerAudioContext
      • InnerAudioContext.play
      • InnerAudioContext.pause
      • InnerAudioContext.stop
      • InnerAudioContext.seek
      • InnerAudioContext.destroy
      • InnerAudioContext.onCanplay
      • InnerAudioContext.onPlay
      • InnerAudioContext.onPause
      • InnerAudioContext.onStop
      • InnerAudioContext.onEnded
      • InnerAudioContext.onTimeUpdate
      • InnerAudioContext.onError
      • InnerAudioContext.onWaiting
      • InnerAudioContext.onSeeking
      • InnerAudioContext.onSeeked
      • InnerAudioContext.offCanplay
      • InnerAudioContext.offPlay
      • InnerAudioContext.offPause
      • InnerAudioContext.offStop
      • InnerAudioContext.offEnded
      • InnerAudioContext.offTimeUpdate
      • InnerAudioContext.offError
      • InnerAudioContext.offWaiting
      • InnerAudioContext.offSeeking
      • InnerAudioContext.offSeeked
    • swan.setInnerAudioOption
    • 视频
      • swan.chooseVideo
      • swan.saveVideoToPhotosAlbum
    • swan.createVideoContext
    • VideoContext
      • VideoContext.play
      • VideoContext.pause
      • VideoContext.seek
      • VideoContext.sendDanmu
      • VideoContext.requestFullScreen
      • VideoContext.exitFullScreen
      • VideoContext.showStatusBar
      • VideoContext.hideStatusBar
      • VideoContext.stop
      • VideoContext.playbackRate
    • swan.createAnimationVideo
    • AnimationVideo
      • AnimationVideo.play
      • AnimationVideo.pause
      • AnimationVideo.seek
    • swan.createLivePlayerContext
    • LivePlayerContext
      • LivePlayerContext.play
      • LivePlayerContext.stop
      • LivePlayerContext.mute
      • LivePlayerContext.pause
      • LivePlayerContext.requestFullScreen
      • LivePlayerContext.exitFullScreen
      • LivePlayerContext.resume
    • swan.createCameraContext
    • CameraContext
      • CameraContext.takePhoto
      • CameraContext.startRecord
      • CameraContext.stopRecord
    • AR 相机组件控制
      • swan.createARCameraContext
      • ARCameraContext
        • ARCameraContext.takePhoto
        • ARCameraContext.reset
        • ARCameraContext.startRecord
        • ARCameraContext.stopRecord
    • 保存、获取文件
      • swan.saveFile
      • swan.getFileInfo
      • swan.getSavedFileList
      • swan.getSavedFileInfo
    • 删除文件 swan.removeSavedFile
    • 打开新的文件页面 swan.openDocument
    • swan.getFileSystemManager
    • FileSystemManager
      • FileSystemManager.access
      • FileSystemManager.accessSync
      • FileSystemManager.appendFile
      • FileSystemManager.appendFileSync
      • FileSystemManager.copyFile
      • FileSystemManager.copyFileSync
      • FileSystemManager.getFileInfo
      • FileSystemManager.getSavedFileList
      • FileSystemManager.mkdir
      • FileSystemManager.mkdirSync
      • FileSystemManager.readdir
      • FileSystemManager.readdirSync
      • FileSystemManager.readFile
      • FileSystemManager.readFileSync
      • FileSystemManager.removeSavedFile
      • FileSystemManager.rename
      • FileSystemManager.renameSync
      • FileSystemManager.rmdir
      • FileSystemManager.rmdirSync
      • FileSystemManager.saveFile
      • FileSystemManager.saveFileSync
      • FileSystemManager.stat
      • FileSystemManager.statSync
      • FileSystemManager.unlink
      • FileSystemManager.unlinkSync
      • FileSystemManager.unzip
      • FileSystemManager.writeFile
      • FileSystemManager.writeFileSync
    • 数据缓存流程
    • swan.setStorage
    • swan.setStorageSync
    • swan.getStorage
    • swan.getStorageSync
    • swan.getStorageInfo
    • swan.getStorageInfoSync
    • swan.removeStorage
    • swan.removeStorageSync
    • swan.clearStorage
    • swan.clearStorageSync
    • 位置
      • 获取位置
        • swan.getLocation
        • swan.chooseLocation
        • swan.startLocationUpdate
        • swan.onLocationChange
        • swan.offLocationChange
        • swan.stopLocationUpdate
      • 查看位置 swan.openLocation
    • swan.createMapContext
    • MapContext
      • MapContext.getCenterLocation
      • MapContext.moveToLocation
      • MapContext.translateMarker
      • MapContext.includePoints
      • MapContext.getRegion
      • MapContext.getScale
    • canvas
    • swan.createCanvasContext
    • swan.canvasGetImageData
    • swan.canvasPutImageData
    • swan.canvasToTempFilePath
    • CanvasContext
      • CanvasContext.setFillStyle
      • CanvasContext.setStrokeStyle
      • CanvasContext.setShadow
      • CanvasContext.createLinearGradient
      • CanvasContext.createCircularGradient
      • CanvasContext.setLineWidth
      • CanvasContext.setLineCap
      • CanvasContext.setLineJoin
      • CanvasContext.setLineDash
      • CanvasContext.setMiterLimit
      • CanvasContext.rect
      • CanvasContext.fillRect
      • CanvasContext.strokeRect
      • CanvasContext.clearRect
      • CanvasContext.fill
      • CanvasContext.stroke
      • CanvasContext.beginPath
      • CanvasContext.closePath
      • CanvasContext.moveTo
      • CanvasContext.lineTo
      • CanvasContext.arc
      • CanvasContext.scale
      • CanvasContext.rotate
      • CanvasContext.translate
      • CanvasContext.clip
      • CanvasContext.setFontSize
      • CanvasContext.fillText
      • CanvasContext.setTextAlign
      • CanvasContext.setTextBaseline
      • CanvasContext.drawImage
      • CanvasContext.setGlobalAlpha
      • CanvasContext.measureText
      • CanvasContext.strokeText
      • CanvasContext.setLineDashOffset
      • CanvasContext.bezierCurveTo
      • CanvasContext.quadraticCurveTo
      • CanvasContext.save
      • CanvasContext.restore
      • CanvasContext.draw
      • CanvasContext.font
      • CanvasContext.setTransform
    • CanvasGradient
      • CanvasGradient.addColorStop
    • swan.showToast
    • swan.showLoading
    • swan.hideToast
    • swan.hideLoading
    • swan.showModal
    • swan.showActionSheet
    • swan.setNavigationBarTitle
    • swan.showNavigationBarLoading
    • swan.hideNavigationBarLoading
    • swan.setNavigationBarColor
    • swan.setTabBarBadge
    • swan.removeTabBarBadge
    • swan.showTabBarRedDot
    • swan.hideTabBarRedDot
    • swan.setTabBarStyle
    • swan.setTabBarItem
    • swan.showTabBar
    • swan.hideTabBar
    • swan.navigateTo
    • swan.redirectTo
    • swan.switchTab
    • swan.navigateBack
    • swan.reLaunch
    • 动画
      • swan.createAnimation
      • Animation
        • Animation.rotate
        • Animation.rotateX
        • Animation.rotateY
        • Animation.rotateZ
        • Animation.rotate3d
        • Animation.scale
        • Animation.scaleX
        • Animation.scaleY
        • Animation.scaleZ
        • Animation.scale3d
        • Animation.translate
        • Animation.translateX
        • Animation.translateY
        • Animation.translateZ
        • Animation.translate3d
        • Animation.skew
        • Animation.skewX
        • Animation.skewY
        • Animation.matrix
        • Animation.matrix3d
    • 位置 swan.pageScrollTo
    • 背景
      • swan.setBackgroundColor
      • swan.setBackgroundTextStyle
    • onPullDownRefresh
    • swan.startPullDownRefresh
    • swan.stopPullDownRefresh
    • 自定义组件 swan.nextTick
    • 菜单 swan.getMenuButtonBoundingClientRect
    • swan.createIntersectionObserver
    • IntersectionObserver
      • IntersectionObserver.relativeTo
      • IntersectionObserver.relativeToViewport
      • IntersectionObserver.observe
      • IntersectionObserver.disconnect
    • swan.createSelectorQuery
    • SelectorQuery
      • SelectorQuery.in
      • SelectorQuery.select
      • SelectorQuery.selectAll
      • SelectorQuery.selectViewport
      • SelectorQuery.exec
    • NodesRef
      • NodesRef.boundingClientRect
      • NodesRef.scrollOffset
      • NodesRef.fields
    • 添加到我的小程序引导 swan.showFavoriteGuide
    • swan.getSystemInfo
    • swan.getSystemInfoSync
    • swan.getEnvInfoSync
    • swan.canIUse
    • 内存 swan.onMemoryWarning
    • swan.getNetworkType
    • swan.onNetworkStatusChange
    • swan.onAccelerometerChange
    • swan.startAccelerometer
    • swan.stopAccelerometer
    • swan.onCompassChange
    • swan.startCompass
    • swan.stopCompass
    • swan.onDeviceMotionChange
    • swan.startDeviceMotionListening
    • swan.stopDeviceMotionListening
    • 获取电量信息
      • swan.getBatteryInfo
      • swan.getBatteryInfoSync
    • 扫码 swan.scanCode
    • swan.setScreenBrightness
    • swan.getScreenBrightness
    • swan.setKeepScreenOn
    • 用户截屏事件 swan.onUserCaptureScreen
    • swan.vibrateLong
    • swan.vibrateShort
    • 手机联系人 swan.addPhoneContact
    • 拨打电话 swan.makePhoneCall
    • swan.setClipboardData
    • swan.getClipboardData
    • swan.addEventOnCalendar
    • swan.deleteEventOnCalendar
    • 获取第三方平台数据
      • swan.getExtConfig
      • swan.getExtConfigSync
    • 开放接口
      • 选择收货地址 swan.chooseAddress
      • 百度收银台支付 swan.requestPolymerPayment
      • 半屏内容发布器
        • swan.openReplyEditor
        • swan.closeReplyEditor
      • 获取发票抬头 swan.chooseInvoiceTitle
      • 分包预下载 swan.loadSubPackage
      • 调试 swan.setEnableDebug
      • 数据分析 swan.reportAnalytics
      • 风控 swan.getSystemRiskInfo
      • 订阅 swan.subscribeService
    • 授权流程说明
    • swan.login
    • getunionid
    • Session Key
    • swan.checkSession
    • swan.isLoginSync
    • 用户数据的签名验证和加解密
    • 需授权接口列表
    • 获取用户授权设置
    • swan.authorize
    • swanid机制说明
    • swan.getSwanId
    • swan.getUserInfo
    • signature 计算方法
    • swan.openSetting
    • swan.getSetting
    • onShareAppMessage
    • swan.openShare
    • swan.shareFile
    • web-view中的分享
    • swan.openCommunityEditor
    • swan.closeCommunityEditor
    • swan.navigateToSmartProgram
    • swan.navigateBackSmartProgram
    • swan.setPageInfo
    • swan.setMetaDescription
    • swan.setMetaKeywords
    • swan.setDocumentTitle
    • swan.getUpdateManager
    • UpdateManager
      • UpdateManager.onCheckForUpdate
      • UpdateManager.onUpdateReady
      • UpdateManager.onUpdateFailed
      • UpdateManager.applyUpdate
    • clearInterval
    • clearTimeout
    • setInterval
    • setTimeout
    • 错误码
    暂无相关搜索结果!

      本文档使用 WanXiangYunDang 构建

      展开/收起文章目录

      思维导图备注

      文章二维码

      手机扫一扫,轻松掌上读

      文档下载

      请下载您需要的格式的文档,随时随地,享受汲取知识的乐趣!
      PDF文档 EPUB文档 MOBI文档

      微信小程序阅读

      BookChat 微信小程序阅读
      微信扫一扫,知识掌上学

      书签列表

        阅读记录

        阅读进度: 0.00% ( 0/0 ) 重置阅读进度