| 227 | if ( preg_match( '#^audio#', $type ) ) { |
| 228 | $meta = wp_read_audio_metadata( $file ); |
| 229 | if ( ! empty( $meta['title'] ) ) |
| 230 | $title = $meta['title']; |
| 231 | |
| 232 | $content = trim( sprintf( |
| 233 | '%s%s%s.', |
| 234 | ! empty( $title ) ? '"' . $title . '"' : '', |
| 235 | ! empty( $meta['album'] ) ? sprintf( ' %s %s', __( 'from' ), $meta['album'] ) : '', |
| 236 | ! empty( $meta['artist'] ) ? sprintf( ' %s %s', __( 'by' ), $meta['artist'] ) : '' |
| 237 | ) ); |
| 238 | |
| 239 | if ( ! empty( $meta['year'] ) ) |
| 240 | $content .= sprintf( ' %s %d.', __( 'Released:' ), $meta['year'] ); |
| 241 | |
| 242 | if ( ! empty( $meta['track_number'] ) ) { |
| 243 | list( $track, $length ) = explode( '/', $meta['track_number'] ); |
| 244 | $content .= sprintf( ' %s %d %s %d.', __( 'Track' ), $track, __( 'of' ), $length ); |
| 245 | } |
| 246 | |
| 247 | if ( ! empty( $meta['genre'] ) ) |
| 248 | $content .= sprintf( ' %s %s.', __( 'Genre:' ), $meta['genre'] ); |
| 249 | |
2393 | | <?php if ( $media_dims ) : ?> |
| 2423 | <?php |
| 2424 | if ( preg_match( '#^audio|video#', $post->post_mime_type ) ): |
| 2425 | |
| 2426 | if ( ! empty( $meta['mime_type'] ) ) : ?> |
| 2427 | <div class="misc-pub-section"> |
| 2428 | <?php _e( 'Mime-type:' ); ?> <strong><?php echo $meta['mime_type']; ?></strong> |
| 2429 | </div> |
| 2430 | <?php |
| 2431 | endif; |
| 2432 | |
| 2433 | if ( ! empty( $meta['bitrate'] ) ) : ?> |
| 2434 | <div class="misc-pub-section"> |
| 2435 | <?php _e( 'Bitrate:' ); ?> <strong><?php |
| 2436 | echo $meta['bitrate'] / 1000, 'kb/s'; |
| 2437 | |
| 2438 | if ( ! empty( $meta['bitrate_mode'] ) ) |
| 2439 | echo ' ', strtoupper( $meta['bitrate_mode'] ); |
| 2440 | |
| 2441 | ?></strong> |
| 2442 | </div> |
| 2443 | <?php |
| 2444 | endif; |
| 2445 | |
| 2446 | if ( ! empty( $meta['audio']['dataformat'] ) ) : ?> |
| 2447 | <div class="misc-pub-section"> |
| 2448 | <?php _e( 'Audio Format:' ); ?> <strong><?php echo $meta['audio']['dataformat']; ?></strong> |
| 2449 | </div> |
| 2450 | <?php |
| 2451 | endif; |
| 2452 | |
| 2453 | if ( ! empty( $meta['audio']['codec'] ) ) : ?> |
| 2454 | <div class="misc-pub-section"> |
| 2455 | <?php _e( 'Audio Codec:' ); ?> <strong><?php echo $meta['audio']['codec']; ?></strong> |
| 2456 | </div> |
| 2457 | <?php |
| 2458 | endif; |
| 2459 | |
| 2460 | if ( ! empty( $meta['year'] ) ) : ?> |
| 2461 | <div class="misc-pub-section"> |
| 2462 | <?php _e( 'Year:' ); ?> <strong><?php echo $meta['year']; ?></strong> |
| 2463 | </div> |
| 2464 | <?php |
| 2465 | endif; |
| 2466 | |
| 2467 | if ( ! empty( $meta['genre'] ) ) : ?> |
| 2468 | <div class="misc-pub-section"> |
| 2469 | <?php _e( 'Genre:' ); ?> <strong><?php echo $meta['genre']; ?></strong> |
| 2470 | </div> |
| 2471 | <?php |
| 2472 | endif; |
| 2473 | |
| 2474 | if ( ! empty( $meta['length_formatted'] ) ) : ?> |
| 2475 | <div class="misc-pub-section"> |
| 2476 | <?php _e( 'Length:' ); ?> <strong><?php echo $meta['length_formatted']; ?></strong> |
| 2477 | </div> |
| 2478 | <?php |
| 2479 | endif; |
| 2480 | |
| 2481 | endif; |
| 2482 | |
| 2483 | if ( $media_dims ) : ?> |