How to use SampleImport ogg?

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 800
Joined: Fri Sep 28, 2012 10:05 am
Contact:

How to use SampleImport ogg?

Post by Ats »

I've been trying to test ZPlatform_Android.pas ReadAssetFile on Android, but I'm stuck.

ReadAssetFile is specific to Android and is called by Platform_ReadFile.
Which is used by ZClasses.pas TZInputStream.CreateFromFile

So in the end, I was trying to read an ogg file. And I'm a bit stuck. Is that how it works?

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ogg reader" FileVersion="2">
  <OnLoaded>
    <PlaySound Sound="SoundOGG"/>
  </OnLoaded>
  <Content>
    <Sample Name="SampleOGG" Length="INF">
      <Producers>
        <SampleImport Comment="Imported from file_example_OOG_1MG.ogg" SampleFormat="1" SampleFileFormat="1"/>
      </Producers>
    </Sample>
    <Sound Name="SoundOGG" Sample="SampleOGG"/>
  </Content>
</ZApplication>
I downloaded the ogg from here: https://file-examples.com/index.php/sam ... -download/
But when I import it, the Sample.length is INF
And the ogg sound isn't playing.

What am I doing wrong?
User avatar
VilleK
Site Admin
Posts: 2371
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: How to use SampleImport ogg?

Post by VilleK »

See attached example for how to play an ogg file.

However the SampleImport only plays embedded files so it does not use ReadAssetFile.Try an example that uses the File component.
Attachments
OggExample.zip
(1.1 MiB) Downloaded 6 times
Post Reply