Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Sound annotation 3 years 10 months ago #15035

  • ShadMaxim
  • ShadMaxim's Avatar Topic Author
  • Offline
  • Banned
  • Banned
  • Posts: 6
  • Thank you received: 0
Hello Radaee. Tell me how you can record on a PDF document such a type of annotations as sound, for example mp3 or other formated (GetType() = 18). Procedure, methods used, and more.

Please Log in or Create an account to join the conversation.

Sound annotation 3 years 10 months ago #15036

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
if Annotation.GetType() = 18
Annotation.GetSoundData return:
paras is array of parameters:
[rate, channels, bits, encoding], all are integer values.
rate is: The sampling rate, in samples per second.
channels is: The number of sound channels.
bits is: The number of bits per sample value per channel.
encoding is:
0. RawUnspecified or unsigned values in the range 0 to 2B − 1
1. SignedTwos-complement values
2. muLawμ-law–encoded samples
3. ALawA-law–encoded samples

about the sound format:
sound file must be self-describing,
The AIFF, AIFF-C (Mac OS), RIFF (. wav), and snd (. au) file formats are all self-describing.
more details, plz see 9.2 section of PDF-Reference 1.7

if Annotation.GetType() != 18, Annotation.GetType() must be 26 (rich media, and most happen)
when Annotation.GetType() = 26,
parameter values are ignored, the format determined by file extension name, for example (.mp3) is mp3 encoding.

Please Log in or Create an account to join the conversation.

Last edit: by radaee.

Sound annotation 3 years 10 months ago #15037

  • ShadMaxim
  • ShadMaxim's Avatar Topic Author
  • Offline
  • Banned
  • Banned
  • Posts: 6
  • Thank you received: 0
Some more questions arose:
1. About method GetSoundData(), we get data in it, and with what method to put / write data to a page?
2. In the knowledge base AddAnnotRichMedia() requires a premium license, and in the documentation a professional or premium license. What is true?(I have a professional license)
3.About the AddAnnotRichMedia () method ... My situation is as follows: users of our application exchange documents (PDF) on which there are annotations. I can’t guarantee that they will have third-party applications for recording / reading sound, so I use the built-in Android SDK MediaPlayer / MediaRecorder, and here there is a problem with the first parameter AddAnnotRichMedia (), where you need to specify the path to the player ("/ sdcard / VideoPlayer. swf "," /sdcard/AudioPlayer.swf "), there is no such way. Tell me what can be done here ...
4.Maybe there is another way to record and snap sound (annotation) to the page?

Please Log in or Create an account to join the conversation.

Last edit: by ShadMaxim.

Sound annotation 3 years 10 months ago #15038

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
GetSoundData() is not mp3 compressed data.
so, you shall compress data to mp3 by your own way.
AddAnnotRichMedia() can add mp3 file or vedio to Annotation depends on player.
AddAnnotRichMedia() run under professional license.
rich media not like sound annotation, it using flash to play sound or video.
some like url: AudioPlayer.swf?test.mp3
this mean, using AudioPlayer.swf to play test.mp3.
so you need player file i attached here, and extract from you asset to a special directory,
the add annotation with player and mp3 file.

the player file is copied from Acrobat, i don't know the copyright, or can you using the player file.
Attachments:
The following user(s) said Thank You: ShadMaxim

Please Log in or Create an account to join the conversation.

Last edit: by radaee.

Sound annotation 3 years 10 months ago #15081

  • ShadMaxim
  • ShadMaxim's Avatar Topic Author
  • Offline
  • Banned
  • Banned
  • Posts: 6
  • Thank you received: 0
Good afternoon, Radaee, I had a problem playing the sound annotation which is saved as page.AddAnnotRichMedia ("/ player / AudioPlayer.swf", newFile.getPath (), 1, document.NewImage (BitmapFactory. decodeResource (context.getResources (), R.drawable.ic_mic_white_circle_blue_), true), pt2); Everything works well if I transfer a PDF document between the clients of our application, but if the client wants to save it, for example, to a computer and open it using Adobe Acrobat Reader , Text and graphic are highlighted and read, but the sound does not work. .. Maybe to open in another application you need to save additional information or fill in additional fields?
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by ShadMaxim.

Sound annotation 3 years 10 months ago #15087

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
this path: "/player/AudioPlayer.swf", maybe a problem.
all file path shall be absolute path.
also newFile.getPath() may return relative path.

i tested AddRichMediaAnnot(), the annotation can play music in Acorbat.
the file is: www.radaeetz.com/123.pdf
i using following codes to add sound annotation:
			PDF_IMAGE dimg = m_doc.DocNewImageJPEG("f:\\img.jpg", false);
			RDRECTF rect;
			rect.left = 100;
			rect.top = 100;
			rect.right = 436;
			rect.bottom = 566;
			m_doc.Page_AddRichMediaAnnot(page->page, "E:\\workspace\\output\\AudioPlayer.swf", "F:\\Seaside.mp3", 1, dimg, rect);
			m_doc.DocSave(NULL);

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum