|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
| 3 | +<reference id="api_seteffectposition"> |
| 4 | + <title><ph keyref="setEffectPosition"/></title> |
| 5 | + <shortdesc id="short"><ph id="shortdesc">设置指定音效文件的播放位置。</ph></shortdesc> |
| 6 | + <prolog> |
| 7 | + <metadata> |
| 8 | + <keywords> |
| 9 | + <indexterm keyref="setEffectPosition"/> |
| 10 | + </keywords> |
| 11 | + </metadata> |
| 12 | + </prolog> |
| 13 | + <refbody> |
| 14 | + <section id="prototype"> |
| 15 | + <p outputclass="codeblock"> |
| 16 | + <codeblock props="android" outputclass="language-java">public int setEffectPosition(int soundId, int pos);</codeblock> |
| 17 | + <codeblock props="ios mac" outputclass="language-objectivec">- (int)setEffectPosition:(int)soundId pos:(NSInteger)pos;</codeblock> |
| 18 | + <codeblock props="windows" outputclass="language-cpp">virtual int setEffectPosition(int soundId, int pos) = 0;</codeblock> |
| 19 | + <codeblock props="electron" outputclass="language-typescript"/> |
| 20 | + <codeblock props="unity" outputclass="language-csharp"/> |
| 21 | + <codeblock props="rn" outputclass="language-typescript"/> |
| 22 | + <codeblock props="flutter" outputclass="language-dart"/> |
| 23 | + </p> |
| 24 | + </section> |
| 25 | + <section id="detailed_desc"> |
| 26 | + <dl outputclass="since"> |
| 27 | + <dlentry> |
| 28 | + <dt>自从</dt> |
| 29 | + <dd>v3.4.0</dd> |
| 30 | + </dlentry> |
| 31 | + </dl> |
| 32 | + <p>成功设置后,本地音效文件会在指定位置开始播放。</p> |
| 33 | + <note type="attention">该方法需要在 <apiname>playEffect</apiname> 后调用。</note> |
| 34 | + </section> |
| 35 | + <section id="parameters"><title>参数</title> |
| 36 | + <parml> |
| 37 | + <plentry> |
| 38 | + <pt>soundId</pt> |
| 39 | + <pd>音效 ID。请确保与 <apiname>playEffect</apiname> 中设置的 <parmname>soundId</parmname> 一致。</pd> |
| 40 | + </plentry> |
| 41 | + <plentry> |
| 42 | + <pt>pos</pt> |
| 43 | + <pd>音效文件的播放位置,单位为毫秒。</pd> |
| 44 | + </plentry> |
| 45 | + </parml> |
| 46 | + </section> |
| 47 | + <section id="return_values"> |
| 48 | + <title>返回值</title> |
| 49 | + <ul> |
| 50 | + <li>0: 方法调用成功</li> |
| 51 | + <li>< 0: 方法调用失败</li> |
| 52 | + </ul> |
| 53 | + </section> |
| 54 | + </refbody> |
| 55 | +</reference> |
0 commit comments