Colocando 2 audios no mesmo panorama

Resolvendo problemas depois da montagem, objetos que se movimentaram, erros de parallax, fotos faltantes, criatividade e as ferramentas para tudo isso.
marcelomaiafotbr
Mensagens: 2
Registrado em: 07 Set 2021, 02:35

Colocando 2 audios no mesmo panorama

Mensagem por marcelomaiafotbr » 08 Set 2021, 00:03

Olá Pessoal / Cartola,

Estou editando um panorama no Panotour pro. Preciso colocar um som instrumental (como background) que tocará em durante todo o passeio em looping, até aqui tudo bem. Só que precisarei em alguns panoramas colocar uma narração e gostaria que se mantivesse esse áudio Background tocando e a locução entrasse em cima. É possível? pelo Xml gerado?

Altero algo nesse código? ou preciso alterar também no codigo base? já que esse é o da locução.

<scene name="pano11"
heading="0"
group="panogroup13"
thumburl="%FIRSTXML%/capela_02_11/thumbnail.jpg"
backgroundsound="off_capela_de_nossa_senhora_da_piedade.mp3"
backgroundsoundloops="0"
haslocalsounds="false"
haspolygons="false"
titleid="pano11_title"
descriptionid=""
multires="true"
planar="false"
full360="true"
video="false"
seen="false">


Muito obrigado

Avatar do usuário
cartola
Site Admin
Mensagens: 1227
Registrado em: 11 Mai 2012, 12:40
Localização: Rio de Janeiro
Contato:

Re: Colocando 2 audios no mesmo panorama

Mensagem por cartola » 08 Set 2021, 12:47

Oi Marcelo,

nunca tinha feito isso, mas fiz um teste aqui e deu certo, consegui botar dois áudios tocando ao mesmo tempo. Daí é só você acertar quando começa cada um, apontando a entrada do panorama como o evento que inicia a narração.

Eu não usei o backgroundsound de uma cena, como você usou ali, mas talvez funcione com isso também. Eu criei um plugin de som e ele gera algumas ações que podem ser disparadas, dentre elas o streamsound, daí eu disparei dois sons e eles tocaram juntos. Foi legal aprender mais essa, pois eu antes já usei narração com música ao fundo e acabei editando o áudio com as duas coisas, criando um áudio único. Agora sei de mais essa possibilidade.

Meu código ficou assim:

Código: Selecionar todos

        <events name="soundplay"
         onnewpano="
                streamsound(bgsnd1, 'audio1.mp3|audio1.ogg', 0);
                streamsound(bgsnd2, 'audio2.mp3|audio2.ogg', 0);
                "
         />
        <plugin name="soundinterface"
              url.html5="plugins/soundinterface.js"
              preload="true"
              preloadsound="true"
              rootpath=""
              volume="1.0"
              mute="false"
        />
No seu caso pode testar manter o áudio lá no backgroundsound e adicionar o plugin pra tocar um segundo áudio e ver se rola. Acredito que o plugin e eventos podem ficar dentro da cena no XML. Eu costumo colocar também uma imagem pra pessoa poder parar o som.

Código: Selecionar todos

        <!-- a button to pause/play the sound -->
        <plugin name="snd" url="soundonoff.png"
                align="centertop" x="100" y="30" alpha="0.25" scale="0.5"
                onover="tween(alpha,1);" onout="tween(alpha,0.25);"
                crop="0|0|50|50"
                onclick="pausesoundtoggle(bgsnd);
                         switch(crop, 0|0|50|50, 0|50|50|50);"
                />
Nesse caso é um botão que só vai parar um áudio. Pra parar os dois tem que adaptar o código fazendo dois "pausesoundtoggle", um pra cada id de áudio criado.

Abraços, Cartola.

marcelomaiafotbr
Mensagens: 2
Registrado em: 07 Set 2021, 02:35

Re: Colocando 2 audios no mesmo panorama

Mensagem por marcelomaiafotbr » 08 Set 2021, 13:43

Eu preciso instalar/baixar esse sondinterface ou somente chamar? está em uma pasta "plugins".

Insiro dentro do meu codigo base xml?

<?xml version="1.0" encoding="UTF-8"?>
<krpano version="1.19">


<!-- Spot Style - Default Point Spot Style -->
<style name="IconDefaultPointSpotStyle"
url="%FIRSTXML%/spots/hotspot_capela_user_defaultpoint0.png"
visible="false"
onhover="onhoverIconDefaultPointSpotStyle"
onout="onoutIconDefaultPointSpotStyle"


/>

<action name="onhoverIconDefaultPointSpotStyle">
showtooltip('hotspot');
</action>


<action name="onoutIconDefaultPointSpotStyle">
hideTooltip();



</action>



<!-- ********** -->
<!-- Cabeçalho -->
<!-- id : header -->
<!-- ********** -->

<layer name="header"
keep="true"
url="%FIRSTXML%/graphics/header/bg_topo.png"
align="top"
x="0"
y="0"
zorder="1"
enabled="false"
capture="true"
visible="false"
height="83"
width="100%"
accuracy="1"
/>

<events name="headerevents"
onTourStart="showheader();"
hidetourcontrols="hideheader();"
showtourcontrols="showheader();"
keep="true" />

<action name="hideheader">
set(layer[header].visible, false);
</action>
<action name="showheader">
set(layer[header].visible, true);
</action>

<!-- ************* -->
<!-- Panorama Menu -->
<!-- ************* -->

<ptplugin name="panoramaMenu" engine="kolorMenu">
<settings>
<option name="position" value="right" type="string" />
<option name="orientation" value="vertical" type="string" />
<option name="sub_orientation" value="vertical" type="string" />
<option name="margin_x" value="5" type="int" />
<option name="margin_y" value="5" type="int" />
<option name="background_color" value="b3b3b3" type="string" />
<option name="background_alpha" value="1" type="float" />
<option name="item_spacer" value="5" type="int" />
<option name="border_radius" value="7" type="int" />
<option name="full_size" value="false" type="bool" />
<option name="use_out_effect" value="true" type="bool" />
<option name="item_out_border_radius" value="7" type="int" />
<option name="item_hover_border_radius" value="7" type="int" />
<option name="item_out_border_width" value="0" type="int" />
<option name="item_hover_border_width" value="0" type="int" />
<option name="item_out_bg_color" value="b3b3b3" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_out_font_color" value="ffffff" type="string" />
<option name="item_out_font_family" value="Arial" type="string" />
<option name="item_out_font_size" value="14" type="int" />
<option name="item_out_font_weight" value="normal" type="string" />
<option name="item_out_font_style" value="normal" type="string" />
<option name="item_out_font_decoration" value="normal" type="string" />
<option name="use_hover_effect" value="true" type="bool" />
<option name="item_hover_bg_color" value="d7d7d7" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />
<option name="item_hover_font_color" value="ffffff" type="string" />
<option name="item_hover_font_family" value="Arial" type="string" />
<option name="item_hover_font_size" value="14" type="int" />
<option name="item_hover_font_weight" value="normal" type="string" />
<option name="item_hover_font_style" value="normal" type="string" />
<option name="item_hover_font_decoration" value="normal" type="string" />
<option name="padding_main" value="10" type="int" />
<option name="padding_sub" value="10" type="int" />
<option name="text_align" value="right" type="string" />
<option name="item_thumb_max_width" value="200" type="int" />
<option name="item_thumb_max_height" value="100" type="int" />

<option name="zorder" value="2" type="int" />
<option name="use_i18n" value="true" type="bool" />
</settings>
<internaldata>
<group name="group_1"
titleID="panogroup57_title"
thumbnail=""
subMenu="false"
cssClass="panogroup57">



<item name="group_1_item_1"
action="invokeKrFunction('mainloadscene', 'pano56')"
titleID="pano56_title"
thumbnail=""
cssClass="pano56">


</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_2"
titleID="panogroup13_title"
thumbnail=""
subMenu="true"
cssClass="panogroup13">



<item name="group_2_item_1"
action="invokeKrFunction('mainloadscene', 'pano10')"
titleID="pano10_title"
thumbnail="Cemiterio Campo Santodata/capela_01_10/thumbnail.jpg"
cssClass="pano10">

<option name="item_out_bg_color" value="807100" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a8800" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_2_item_2"
action="invokeKrFunction('mainloadscene', 'pano11')"
titleID="pano11_title"
thumbnail="Cemiterio Campo Santodata/capela_02_11/thumbnail.jpg"
cssClass="pano11">

<option name="item_out_bg_color" value="807100" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a8800" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>

<option name="background_color" value="807100" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_3"
titleID="panogroup26_title"
thumbnail=""
subMenu="true"
cssClass="panogroup26">



<item name="group_3_item_1"
action="invokeKrFunction('mainloadscene', 'pano15')"
titleID="pano15_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_02_15/thumbnail.jpg"
cssClass="pano15">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_2"
action="invokeKrFunction('mainloadscene', 'pano14')"
titleID="pano14_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_01_14/thumbnail.jpg"
cssClass="pano14">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_3"
action="invokeKrFunction('mainloadscene', 'pano20')"
titleID="pano20_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_07_20/thumbnail.jpg"
cssClass="pano20">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_4"
action="invokeKrFunction('mainloadscene', 'pano21')"
titleID="pano21_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_08_21/thumbnail.jpg"
cssClass="pano21">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_5"
action="invokeKrFunction('mainloadscene', 'pano22')"
titleID="pano22_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_09_22/thumbnail.jpg"
cssClass="pano22">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_6"
action="invokeKrFunction('mainloadscene', 'pano17')"
titleID="pano17_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_04_17/thumbnail.jpg"
cssClass="pano17">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_7"
action="invokeKrFunction('mainloadscene', 'pano16')"
titleID="pano16_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_03_16/thumbnail.jpg"
cssClass="pano16">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_8"
action="invokeKrFunction('mainloadscene', 'pano23')"
titleID="pano23_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_10_23/thumbnail.jpg"
cssClass="pano23">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_9"
action="invokeKrFunction('mainloadscene', 'pano19')"
titleID="pano19_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_06_19/thumbnail.jpg"
cssClass="pano19">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_10"
action="invokeKrFunction('mainloadscene', 'pano18')"
titleID="pano18_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_05_18/thumbnail.jpg"
cssClass="pano18">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_3_item_11"
action="invokeKrFunction('mainloadscene', 'pano24')"
titleID="pano24_title"
thumbnail="Cemiterio Campo Santodata/circuito_cultural_11_24/thumbnail.jpg"
cssClass="pano24">

<option name="item_out_bg_color" value="800002" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a0002" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>

<option name="background_color" value="800002" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_4"
titleID="panogroup45_title"
thumbnail=""
subMenu="true"
cssClass="panogroup45">



<item name="group_4_item_1"
action="invokeKrFunction('mainloadscene', 'pano38')"
titleID="pano38_title"
thumbnail="Cemiterio Campo Santodata/velorio_sala01_38/thumbnail.jpg"
cssClass="pano38">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_4_item_2"
action="invokeKrFunction('mainloadscene', 'pano36')"
titleID="pano36_title"
thumbnail="Cemiterio Campo Santodata/sala_velorio_entrada_36/thumbnail.jpg"
cssClass="pano36">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_4_item_3"
action="invokeKrFunction('mainloadscene', 'pano37')"
titleID="pano37_title"
thumbnail="Cemiterio Campo Santodata/sala_velorio_entrada_37/thumbnail.jpg"
cssClass="pano37">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_4_item_4"
action="invokeKrFunction('mainloadscene', 'pano39')"
titleID="pano39_title"
thumbnail="Cemiterio Campo Santodata/velorio_sala02_39/thumbnail.jpg"
cssClass="pano39">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_4_item_5"
action="invokeKrFunction('mainloadscene', 'pano40')"
titleID="pano40_title"
thumbnail="Cemiterio Campo Santodata/velorio_sala02_espac_40/thumbnail.jpg"
cssClass="pano40">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_4_item_6"
action="invokeKrFunction('mainloadscene', 'pano41')"
titleID="pano41_title"
thumbnail="Cemiterio Campo Santodata/velorio_tamanho_exte_41/thumbnail.jpg"
cssClass="pano41">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_4_item_7"
action="invokeKrFunction('mainloadscene', 'pano42')"
titleID="pano42_title"
thumbnail="Cemiterio Campo Santodata/velorio_tamanho_exte_42/thumbnail.jpg"
cssClass="pano42">

<option name="item_out_bg_color" value="010180" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="01019a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>

<option name="background_color" value="010180" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_5"
titleID="panogroup63_title"
thumbnail=""
subMenu="true"
cssClass="panogroup63">



<item name="group_5_item_1"
action="invokeKrFunction('mainloadscene', 'pano61')"
titleID="pano61_title"
thumbnail="Cemiterio Campo Santodata/novo_campo_santo_fon_61/thumbnail.jpg"
cssClass="pano61">

<option name="item_out_bg_color" value="258048" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="2c9a56" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_5_item_2"
action="invokeKrFunction('mainloadscene', 'pano58')"
titleID="pano58_title"
thumbnail="Cemiterio Campo Santodata/ecologicas_01_58/thumbnail.jpg"
cssClass="pano58">

<option name="item_out_bg_color" value="258048" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="2c9a56" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_5_item_3"
action="invokeKrFunction('mainloadscene', 'pano59')"
titleID="pano59_title"
thumbnail="Cemiterio Campo Santodata/ecologicas_02_59/thumbnail.jpg"
cssClass="pano59">

<option name="item_out_bg_color" value="258048" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="2c9a56" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_5_item_4"
action="invokeKrFunction('mainloadscene', 'pano60')"
titleID="pano60_title"
thumbnail="Cemiterio Campo Santodata/ecologicas_03_60/thumbnail.jpg"
cssClass="pano60">

<option name="item_out_bg_color" value="258048" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="2c9a56" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>

<option name="background_color" value="258048" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_6"
titleID="panogroup54_title"
thumbnail=""
subMenu="true"
cssClass="panogroup54">



<item name="group_6_item_1"
action="invokeKrFunction('mainloadscene', 'pano50')"
titleID="pano50_title"
thumbnail="Cemiterio Campo Santodata/cremartorio_frente_f_50/thumbnail.jpg"
cssClass="pano50">

<option name="item_out_bg_color" value="801e6e" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a2484" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_6_item_2"
action="invokeKrFunction('mainloadscene', 'pano52')"
titleID="pano52_title"
thumbnail="Cemiterio Campo Santodata/cremartorio_entrada_52/thumbnail.jpg"
cssClass="pano52">

<option name="item_out_bg_color" value="801e6e" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a2484" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_6_item_3"
action="invokeKrFunction('mainloadscene', 'pano51')"
titleID="pano51_title"
thumbnail="Cemiterio Campo Santodata/cremartorio_lateral__51/thumbnail.jpg"
cssClass="pano51">

<option name="item_out_bg_color" value="801e6e" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a2484" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>

<option name="background_color" value="801e6e" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_7"
titleID="panogroup86_title"
thumbnail=""
subMenu="false"
cssClass="panogroup86">



<item name="group_7_item_1"
action="invokeKrFunction('mainloadscene', 'pano85')"
titleID="pano85_title"
thumbnail=""
cssClass="pano85">


</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_8"
titleID="panogroup92_title"
thumbnail=""
subMenu="true"
cssClass="panogroup92">



<item name="group_8_item_1"
action="invokeKrFunction('mainloadscene', 'pano88')"
titleID="pano88_title"
thumbnail="Cemiterio Campo Santodata/ossuario_01_88/thumbnail.jpg"
cssClass="pano88">

<option name="item_out_bg_color" value="808080" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a9a9a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_8_item_2"
action="invokeKrFunction('mainloadscene', 'pano89')"
titleID="pano89_title"
thumbnail="Cemiterio Campo Santodata/ossuario_02_89/thumbnail.jpg"
cssClass="pano89">

<option name="item_out_bg_color" value="808080" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a9a9a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>
<item name="group_8_item_3"
action="invokeKrFunction('mainloadscene', 'pano90')"
titleID="pano90_title"
thumbnail="Cemiterio Campo Santodata/ossuario_03_90/thumbnail.jpg"
cssClass="pano90">

<option name="item_out_bg_color" value="808080" type="string" />
<option name="item_out_bg_alpha" value="1" type="float" />
<option name="item_hover_bg_color" value="9a9a9a" type="string" />
<option name="item_hover_bg_alpha" value="1" type="float" />

</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_9"
titleID="panogroup97_title"
thumbnail=""
subMenu="false"
cssClass="panogroup97">



<item name="group_9_item_1"
action="invokeKrFunction('mainloadscene', 'pano96')"
titleID="pano96_title"
thumbnail=""
cssClass="pano96">


</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_10"
titleID="panogroup99_title"
thumbnail=""
subMenu="false"
cssClass="panogroup99">



<item name="group_10_item_1"
action="invokeKrFunction('mainloadscene', 'pano98')"
titleID="pano98_title"
thumbnail=""
cssClass="pano98">


</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_11"
titleID="panogroup102_title"
thumbnail=""
subMenu="false"
cssClass="panogroup102">



<item name="group_11_item_1"
action="invokeKrFunction('mainloadscene', 'pano100')"
titleID="pano100_title"
thumbnail=""
cssClass="pano100">


</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
<group name="group_12"
titleID="panogroup103_title"
thumbnail=""
subMenu="false"
cssClass="panogroup103">



<item name="group_12_item_1"
action="invokeKrFunction('mainloadscene', 'pano101')"
titleID="pano101_title"
thumbnail=""
cssClass="pano101">


</item>

<option name="background_color" value="808080" type="string" />
<option name="background_alpha" value="1" type="float" />

</group>
</internaldata>
</ptplugin>

<action name="kolorMenuJsReady_panoramaMenu">
set(ptplugin[panoramaMenu].jsready, true);
</action>

<action name="showKolorMenu_panoramaMenu">

ifnot(ptplugin[panoramaMenu].isOpen,
stopdelayedcall(delay_panoramaMenu);
set(ptplugin[panoramaMenu].isOpen, true);
set(ptplugin[panoramaMenu].displayed, true);
js(openKolorMenu(panoramaMenu));
,
if(ptplugin[panoramaMenu].jsready,
stopdelayedcall(delay_panoramaMenu);
set(ptplugin[panoramaMenu].displayed, true);
js(invokePluginFunction(panoramaMenu, showKolorMenu));
,
delayedcall(delay_panoramaMenu, 0.1, showKolorMenu_panoramaMenu(););
);
);
</action>

<action name="hideKolorMenu_panoramaMenu">
if(ptplugin[panoramaMenu].jsready,
stopdelayedcall(delay_panoramaMenu);
set(ptplugin[panoramaMenu].displayed, false);
js(invokePluginFunction(panoramaMenu, hideKolorMenu));
,
delayedcall(delay_panoramaMenu, 0.1, hideKolorMenu_panoramaMenu(););
);
</action>


<action name="changeLanguage_panoramaMenu">
if(ptplugin[panoramaMenu].jsready,
stopdelayedcall(delay_panoramaMenu);
js(invokePluginFunction(panoramaMenu, changeLanguage));
,
delayedcall(delay_panoramaMenu, 0.1, changeLanguage_panoramaMenu(););
);
</action>


<events name="kolorMenuEvents_panoramaMenu"
keep="true"


onTourStart="showKolorMenu_panoramaMenu();"
changetourlanguage="changeLanguage_panoramaMenu"
/>

<!-- ********** -->
<!-- Logo -->
<!-- id : logo -->
<!-- ********** -->

<layer align="topleft"
x="30"
y="10"
zorder="3"
name="logo"
keep="true"
visible="false"
capture="false"

tooltip="logotooltipText"
onhover="showTooltip('plugin');"
onout="hideTooltip();"
url="%FIRSTXML%/graphics/logo/logo_quadrada.png"
onclick="openurl(https://www.cemiteriocamposanto.org.br,_blank);
"

height="104"
width="104"

/>

<events name="logoevents"
onTourStart="showlogo();"
hidetourcontrols="hidelogo();"
showtourcontrols="showlogo();"
keep="true" />

<action name="hidelogo">
set(layer[logo].visible, false);
</action>
<action name="showlogo">
if (tour_displaycontrols,
set(layer[logo].visible, true);
);
</action>




<!-- Sounds Management -->
<plugin name="soundinterface"
preload="true"
url="%FIRSTXML%/graphics/soundinterface.js"
rootpath="%$videos_sounds_path%/sounds"
backgroundsound=""
backgroundsoundloops="0"
bgsound="false"
bgsoundpaused="false"
bgsoundloopended="false"
volumeinitialized="false"
started="true"
keep="true"/>
<events name="soundmanagementevents"
onnewpano="if(plugin[soundinterface].started,playbackgroundsound(););"
onxmlcomplete="soundinterfaceonxmlcomplete();"
keep="true"/>
<action name="soundinterfaceonxmlcomplete">
ifnot(plugin[soundinterface].volumeinitialized,
div(plugin[soundinterface].volume, tour_soundsvolume, 100);
set(plugin[soundinterface].volumeinitialized,true);
);
</action>
<action name="playsound3Dwhenpossible">
set(really_play_sound, true);
if (tour_current_played_sound,
if (%1 == tour_current_played_sound,
delete(tour_current_played_sound);
set(tour_current_played_sound_state, 0);
delete(tour_current_played_sound_paused);
stopsound(%1);
set(really_play_sound, false);
if(%4,
delete(tour_current_played_sound_pausesound);
resumeTourSoundsActions(true,true,true,true,true);
);
);
);
if (really_play_sound,
if (tour_current_played_sound,
stopsound(get(tour_current_played_sound));

ifnot(%4,
if(tour_current_played_sound_pausesound,
delete(tour_current_played_sound_pausesound);
resumeTourSoundsActions(true,true,true,true,true);
);
);
);
if(%4,
set(tour_current_played_sound_pausesound, true);
pauseTourSoundsActions(true,false,true,true,true);
);
set(tour_current_played_sound, %1);
if(tour_current_played_video,
set(tour_current_played_sound_state, 2);
,
set(tour_current_played_sound_state, 1);
);
set(tour_current_played_sound_paused, false);
if (%3,
if (device.flash,
div(volume, tour_soundsvolume, 100);
if(%9 != null,
playsound3D(%1,%2,%5,%6,%7,get(volume),%8,stopsound3Dwhenpossible(%1,%4));
,
playsound3D(%1,%2,%5,%6,%7,get(volume),%8);
);
,
if(%9 != null,
playsound(%1,%2,%8,stopsound3Dwhenpossible(%1,%4));
,
playsound(%1,%2,%8);
);
);
,
if(%6 != null,
playsound(%1,%2,%5,stopsound3Dwhenpossible(%1,%4));
,
playsound(%1,%2,%5);
);
);

ifnot(tour_soundson,
set(tour_current_played_sound_paused, true);
pausesound(%1);
);
);
</action>
<action name="stopsound3Dwhenpossible">
if (%1 == tour_current_played_sound,
delete(tour_current_played_sound);
set(tour_current_played_sound_state, 0);
delete(tour_current_played_sound_paused);

ifnot(device.safari,
stopsound(%1);
);
if(%2,
delete(tour_current_played_sound_pausesound);
resumeTourSoundsActions(true,true,true,true,true);
);
);
</action>
<action name="playbackgroundsound">
if(playsound,
if (xml.scene,
if (scene[get(xml.scene)].backgroundsound,
if (plugin[soundinterface].backgroundsound != scene[get(xml.scene)].backgroundsound,
copy(plugin[soundinterface].backgroundsound, scene[get(xml.scene)].backgroundsound);
copy(plugin[soundinterface].backgroundsoundloops, scene[get(xml.scene)].backgroundsoundloops);
if (tour_soundson,
set(plugin[soundinterface].bgsound, true);
set(plugin[soundinterface].bgsoundpaused, false);
set(plugin[soundinterface].bgsoundloopended, false);
if(plugin[soundinterface].backgroundsoundloops GT 0,
playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops), stopbackgroundsoundoncomplete());
,
playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
);
,
set(plugin[soundinterface].bgsound, false);
);
,
if (tour_soundson,
if((plugin[soundinterface].bgsoundpaused == true AND scene[get(xml.scene)].video == false) OR (scene[get(xml.scene)].video == true AND scene[get(xml.scene)].scenevideomute == true),
resumesound(bgsoundname);
set(plugin[soundinterface].bgsoundpaused, false);
);
,
set(plugin[soundinterface].bgsound, false);
);
);
);
);
,
delayedcall(0.2, playbackgroundsound());
);
</action>
<action name="stopbackgroundsoundoncomplete">
if (plugin[soundinterface].backgroundsound,
if (plugin[soundinterface].backgroundsoundloops GT 0,

set(plugin[soundinterface].backgroundsoundloops, 0);
set(plugin[soundinterface].bgsound, false);
set(plugin[soundinterface].bgsoundpaused, false);
set(plugin[soundinterface].bgsoundloopended, true);
);
);
</action>
<action name="resetbackgroundsoundifneeded">
if (xml.scene,
if (scene[get(xml.scene)].backgroundsound != scene[%1].backgroundsound,
if(plugin[soundinterface].backgroundsound,
stopsound(bgsoundname);
);
set(plugin[soundinterface].backgroundsound, "");
set(plugin[soundinterface].backgroundsoundloops, 0);
set(plugin[soundinterface].bgsound, false);
set(plugin[soundinterface].bgsoundpaused, false);
set(plugin[soundinterface].bgsoundloopended, false);
);
);
</action>
<action name="pausebackgroundsound">
if(plugin[soundinterface].backgroundsound,
if (plugin[soundinterface].bgsound,
if(plugin[soundinterface].bgsoundpaused == false AND plugin[soundinterface].bgsoundloopended == false,
pausesound(bgsoundname);
set(plugin[soundinterface].bgsoundpaused, true);
);
);
);

</action>
<action name="resumebackgroundsound">
set(bgSoundOnResume, true);
set(forceBgSoundOnResume, true);
if(layer[displayedStandardVideo],
if(layer[displayedStandardVideo].pausebgsound AND tour_current_played_video,
set(bgSoundOnResume, false);
set(forceBgSoundOnResume, false);
););
if(layer[webvideodisplay_player],
if(layer[webvideodisplay_player].pausebgsound AND tour_current_played_web_video,
set(bgSoundOnResume, false);
set(forceBgSoundOnResume, false);
););
if(tour_current_played_sound_pausesound AND tour_current_played_sound,
set(bgSoundOnResume, false);
);
ifnot(plugin[soundinterface].backgroundsound AND scene[get(xml.scene)].backgroundsound,
set(bgSoundOnResume, false);
);
if(videospots_playing GT 0,
set(bgSoundOnResume, false);
set(forceBgSoundOnResume, false);
);
if(bgSoundOnResume,
if (plugin[soundinterface].backgroundsound,
if (tour_soundson,
if (plugin[soundinterface].bgsound AND plugin[soundinterface].bgsoundloopended == false,
if((plugin[soundinterface].bgsoundpaused == true AND scene[get(xml.scene)].video == false) OR (scene[get(xml.scene)].video == true AND scene[get(xml.scene)].scenevideomute == true),
resumesound(bgsoundname);
set(plugin[soundinterface].bgsoundpaused, false);
);
,
set(plugin[soundinterface].bgsound, true);
set(plugin[soundinterface].bgsoundpaused, false);
set(plugin[soundinterface].bgsoundloopended, false);
if(plugin[soundinterface].backgroundsoundloops GT 0,
playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops), stopbackgroundsoundoncomplete());
,
playsound(bgsoundname, get(plugin[soundinterface].backgroundsound), get(plugin[soundinterface].backgroundsoundloops));
);
);
);
);

,
if(forceBgSoundOnResume,
playbackgroundsound();

);
);
</action>
<action name="preloadSounds">
preloadsound("_1.mp3");
preloadsound("off_capela_de_nossa_senhora_da_piedade.mp3");
preloadsound("off_circuito_cultural.mp3");
preloadsound("off_sala_de_cerimonias_em_4d.mp3");
preloadsound("off_novo_campo_santo.mp3");
preloadsound("off_crematorio.mp3");
</action>

<action name="play3DLocalSounds">
if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, playpanolocalsounds();););
</action>
<action name="stop3DLocalSounds">
if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, stoppanolocalsounds();););
</action>
<action name="resume3DLocalSounds">
if (xml.scene, if (scene[get(xml.scene)].haslocalsounds,
set(kill3dSoundOnResume, true);
if(layer[displayedStandardVideo],
if(layer[displayedStandardVideo].pausebgsound,
if(tour_current_played_video,
set(kill3dSoundOnResume, false);
);););
if(layer[webvideodisplay_player],
if(layer[webvideodisplay_player].pausebgsound,
if(tour_current_played_web_video,
set(kill3dSoundOnResume, false);
);););
if(tour_current_played_sound_pausesound,
if(tour_current_played_sound,
set(kill3dSoundOnResume, false);
););
if(kill3dSoundOnResume,
resumepanolocalsounds();
);
););
</action>
<action name="pause3DLocalSounds">
if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, pausepanolocalsounds();););
</action>
<action name="set3DLocalSoundsVolume">
if (xml.scene, if (scene[get(xml.scene)].haslocalsounds, setpanolocalsoundsvolume();););
</action>
<action name="playTourSounds">
set(tour_soundson, true);events.dispatch(playtoursoundsevent);
resumeTourSoundsActions(true,true,true,true,true);
</action>
<action name="stopTourSounds">
set(tour_soundson, false);events.dispatch(stoptoursoundsevent);
pauseTourSoundsActions(true,true,true,true,true);
</action>
<action name="setTourSoundsVolume">
set(tour_soundsvolume, %1);events.dispatch(changetoursoundsevent);
div(volume, tour_soundsvolume, 100);
set(plugin[soundinterface].volume, get(volume));
set3DLocalSoundsVolume();
</action>
<action name="playTourSoundsActions">
if(%1,
if(plugin[soundinterface],
if(plugin[soundinterface].started,
play3DLocalSounds();
);
);
);
if(%2,
if(plugin[soundinterface],
if(plugin[soundinterface].started,
resumebackgroundsound();
);
);
);
</action>
<action name="stopTourSoundsActions">
if(%1,
stop3DLocalSounds();
);
if(%2,
stopSoundActionsSounds();
);
if(%3,
stopVideoActionsSounds();
);
if(%4,
pausebackgroundsound();
);
</action>
<action name="resumeTourSoundsActions">
if(%1,
if(plugin[soundinterface],
if(plugin[soundinterface].started,
resume3DLocalSounds();
);
);
);
if(%2,
resumeSoundActionsSounds();
);
if(%3,
resumeVideoActionsSounds();
);
if(%4,
if(%5,
if(plugin[soundinterface],
if(plugin[soundinterface].started,
resumebackgroundsound();
);
);
,
pausebackgroundsound();
);
);
</action>
<action name="pauseTourSoundsActions">
if(%1,
pause3DLocalSounds();
);
if(%2,
pauseSoundActionsSounds();
);
if(%3,
pauseVideoActionsSounds();
);
if(%4,
if(%5,
pausebackgroundsound();
,
if(plugin[soundinterface],
if(plugin[soundinterface].started,
resumebackgroundsound();
);
);
);
);
</action>
<action name="stopSoundActionsSounds">
if (tour_current_played_sound,
delete(tour_current_played_sound_paused);
stopsound(get(tour_current_played_sound));
delete(tour_current_played_sound);
set(tour_current_played_sound_state, 0);
);
</action>
<action name="stopVideoActionsSounds">
if(tour_current_played_video,
if(layer[displayedStandardVideo],
layer[displayedStandardVideo].stop();
removelayer(displayedStandardVideo);
if(layer[displayedStandardVideoOverlayButton], removelayer(displayedStandardVideoOverlayButton); );
if(layer[displayedStandardVideoOverlay], removelayer(displayedStandardVideoOverlay); );
delete(tour_current_played_video);
set(tour_current_played_video_state, 0);
);
);
if(tour_current_played_web_video,
displayWebVideoObjectClose();
);
</action>
<action name="resumeSoundActionsSounds">
if (tour_current_played_sound,
set(resumeSoundActionsVerification, true);
if(tour_current_played_video,
if(tour_current_played_sound_state LT tour_current_played_video_state,
set(resumeSoundActionsVerification, false);
);
);
if(resumeSoundActionsVerification,
if (tour_soundson,
if(tour_current_played_sound_paused,
set(tour_current_played_sound_paused, false);
resumesound(get(tour_current_played_sound));
);
);
);
);
</action>
<action name="resumeVideoActionsSounds">
if(tour_current_played_video,
set(resumeVideoActionsVerification, true);
if(tour_current_played_sound,
if(tour_current_played_video_state LT tour_current_played_sound_state,
set(resumeVideoActionsVerification, false);
);
);
if(resumeVideoActionsVerification,
if (tour_soundson,
div(volume, tour_soundsvolume, 100);
if(device.flash,
set(layer[displayedStandardVideo].volume, get(volume));
,
ifnot(device.ios,
js(kpanotour.Sounds.startVideosSounds(get(volume)));
);
);
,
if(device.flash,
set(layer[displayedStandardVideo].volume, 0);
,
ifnot(device.ios,
js(kpanotour.Sounds.stopVideosSounds());
);
);
);
);
);
</action>
<action name="pauseSoundActionsSounds">
if (tour_current_played_sound,
ifnot(tour_current_played_sound_paused,
set(tour_current_played_sound_paused, true);
pausesound(get(tour_current_played_sound));
);
);
</action>
<action name="pauseVideoActionsSounds">
if(tour_current_played_video,
if(device.flash,
set(layer[displayedStandardVideo].volume, 0);
,
ifnot(device.ios,
js(kpanotour.Sounds.stopVideosSounds());
);
);
);
</action>

</krpano>

Avatar do usuário
cartola
Site Admin
Mensagens: 1227
Registrado em: 11 Mai 2012, 12:40
Localização: Rio de Janeiro
Contato:

Re: Colocando 2 audios no mesmo panorama

Mensagem por cartola » 08 Set 2021, 18:07

Oi Marcelo,

fiquei na dúvida se você afirmou que o "soundinterface" está numa pasta plugins ou se seria uma dúvida e esqueceu de botar interrogação.

Acredito que ele já esteja numa pasta plugins, mas se não estiver deve estar em algum outro lugar no meio dos arquivos que o Panotour criou da sua publicação. Aqui no meu caso estava numa pasta "plugins", por isso meu código o apontava lá. O Panotour, porém, organiza as coisas de forma mais complexa que o krpano e eu não conheço nem tenho o Panotour pra testar. Pelo que olhei ali no código que você postou, já há menções ao soundinterface, o que me sugere que ele já esteja disponível, mas realmente se ele não estiver numa pasta "plugins" e você apontar pra ela, ele não vai achar, então vc tem que saber onde ele está e apontar pra lá.

Depois disso você teria que encontrar o código da cena específica onde quer colocar a locução pra fazer o som tocar só lá. Nesse código que você postou agora o código da cena não aparece, mas na sua primeira mensagem tinha lá o "<scene name="pano11" ... >" então se você colocar o evento pra tocar o som dentro dela, entre o <scene> e o </scene> dela, isso vai ficar restrito a essa cena/panorama. Há várias maneiras de disparar um evento, tem que ver o que é melhor nesse caso. Eu costumo olhar na documentação do 'events' o que melhor se encaixa em cada caso. Nesse seu caso talvez um "onnewscene" ou "onnewpano", mas tenho dúvida, teria que testar. Já usei muito "onloadcomplete" e "onxmlcomplete".

Pelo último código que postou agora acredito que um plugin "soundinterface" possa já estar criado, então bastaria usar o "events" pra disparar o som. Pode fazer assim e testar e ver se aparece algum erro.

Abs.

Responder